pyissm.model.classes.independent
- class pyissm.model.classes.independent(other=None)
Bases:
manage_stateIndependent variable class for ISSM.
This class contains parameters for independent variables in the ISSM framework. Independent variables are parameters that can be optimized or varied during inverse problems, sensitivity analysis, or uncertainty quantification studies.
- Parameters:
other (any, optional) – Any other class object that contains common fields to inherit from. If values in
otherdiffer from default values, they will override the default values.
- name
Variable name (must match corresponding String).
- Type:
str, default=’’
- type
Type of variable (‘vertex’ or ‘scalar’).
- Type:
str, default=’’
- fos_forward_index
Index for fos_forward driver of ADOLC.
- Type:
float, default=np.nan
- fov_forward_indices
Indices for fov_forward driver of ADOLC.
- Type:
numpy.ndarray, default=np.array([])
- nods
Size of independent variables.
- Type:
int, default=0
- min_parameters
Absolute minimum acceptable value of the inversed parameter on each vertex.
- Type:
float, default=np.nan
- max_parameters
Absolute maximum acceptable value of the inversed parameter on each vertex.
- Type:
float, default=np.nan
- control_scaling_factor
Order of magnitude of each control (useful for multi-parameter optimization).
- Type:
float, default=1.0
- control_size
Number of timesteps.
- Type:
int, default=1
Examples
>>> md.independent = pyissm.model.classes.independent() >>> md.independent.name = 'FrictionCoefficient' >>> md.independent.type = 'vertex' >>> md.independent.min_parameters = 1e-3 >>> md.independent.max_parameters = 100
- __init__(other=None)
Initialize the instance with optional field inheritance.
- Parameters:
other (
object, optional) – Another instance to inherit field values from. If provided, any fields in the current instance that differ from the default values and exist in ‘other’ will be replaced with the values from ‘other’.
Notes
The inheritance process:
Iterates through all attributes of the current instance
Checks if the same attribute exists in the ‘other’ instance
Compares field values using _fields_equal()
If different, replaces the current value with the ‘other’ value
This enables the common ISSM pattern where classes can inherit configurations from existing instances while maintaining their default values for unspecified fields.
Methods
__init__([other])Initialize the instance with optional field inheritance.
check_consistency(md, solution, analyses)Check consistency of the [independent] parameters.
issm_enum_string()Default ISSM C++ enum string used during marshalling.
- check_consistency(md, solution, analyses)
Check consistency of the [independent] parameters.
- Parameters:
md (
pyissm.model.Model) – The model object to check.solution (
str) – The solution name to check.analyses (list of
str) – List of analyses to check consistency for.
- Returns:
md – The model object with any consistency errors noted.
- Return type: