cideMOD.cell.parameters
Classes
|
Class abstracting a cell parameter. |
- class cideMOD.cell.parameters.CellParameter(component, dic: dict | None, name: str, dtypes: Tuple[str] | str | None = 'real', is_optional=False, can_vary: bool = True, can_effective: bool = False, can_arrhenius: bool = False, can_ref_temperature: bool = False, can_hysteresis: bool = False, data_path: str | None = None, description: str | None = None, aliases: list | tuple = [], is_user_input: bool = True)[source]
Bases:
objectClass abstracting a cell parameter.
- Parameters:
component (BaseComponentParser) – Object that parses the component parameters.
dic (Optional[dict]) –
Dictionary with cell parameter information. Contains:
’value’: Value of the parameter.
’unit’: Units of the parameter. Optional.
’effective’: Whether or not is an effective value. Optional
’arrhenius’: Dictionary containing the arrhenius parameters. Contains activationEnergy and referenceTemperature. Optional.
’referenceTemperature’: Temperature of reference of this parameter. Optional.
’source’: Type of source of the data. Right now ‘file’ is the only one implemented. Only used if the dtype is ‘spline’. Optional.
’spline_type’: Type of spline to used. It must be either not-a-knot for cubic interpolation or Akima1D for Akima interpolation. Only used if the dtype is ‘spline’. Optional.
name (str) – Name of the cell parameter.
dtypes (Optional[Union[Tuple[str], str]]) – Available datatypes that are allowed. It must be one of real, expression, spline or label.
is_optional (bool) – Whether this parameter is optional or not. Default to True.
can_vary (bool) – Whether this parameter can be defined as a dynamic parameter. Default to True.
can_effective (bool) – Whether this parameter can be defined as an effective parameter. Default to False.
can_arrhenius (bool) – Whether the arrhenius correction can be applied to this parameter. Default to False.
can_ref_temperature (bool) – Whether this parameter can have a reference temperature.
can_hysteresis (bool) – Whether this parameter can have hysteresis.
data_path (Optional[str]) – Path to the referenced data if the given source is a file.
description (Optional[str]) – Description of the parameter.
aliases (Union[list, tuple]) – List or tuple containing the aliases of the parameter if any.
- get_arrhenius()[source]
Get arrhenius parameters if given
- Returns:
float, int – Activation energy
float, int – Reference temperature
- Raises:
RuntimeError – ‘arrhenius’ field has not been specified
- get_reference_temperature()[source]
Get the reference temperature if given
- Returns:
Reference temperature
- Return type:
float, int
- Raises:
RuntimeError – ‘referenceTemperature’ field has not been specified
- make_dynamic_parameter()[source]
This method makes this parameter be a dynamic parameter. The parameter’s dtype must be real. This method must be called before setting up this parameter.
- make_mesh_dependent(value: dolfinx.fem.Function, ref_value: float | int)[source]
This method makes this parameter be mesh dependent. The parameter’s dtype must be real and no further preprocessing should be needed.
- Parameters:
value (dfx.fem.Function) – Value of the parameter.
ref_value (Union[float, int]) – Reference value to be used.
- make_reference_temperature_mandatory()[source]
This method makes this parameter has a reference temperature.
- property ref_value
- reset()[source]
This method clear the preprocessed values in order to recompute them again with new parameters or problem.
- set_value(value)[source]
This method set the value of the parameter. Tipically used to set the default value of optional parameters if they have not been provided, for internal parameters or even to allow the user modifing its own inputs.
- Parameters:
value (Any) – Value of the parameter.
- setup_dynamic_parameter(mesh)[source]
This method set the mesh associated to the dynamic parameter.
- property user_value
- property value