pyissm.model.classes.damage
- class pyissm.model.classes.damage(other=None)
Bases:
manage_stateDamage mechanics class for ISSM.
This class contains parameters for damage mechanics in the ISSM framework. Damage mechanics models the evolution of cracks and fractures in ice, affecting ice rheology and flow. It is particularly important for modeling ice shelf stability, calving, and fracture propagation.
- 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.
- isdamage
Is damage mechanics being used? [0 (default) or 1].
- Type:
int, default=0
- D
Damage tensor (scalar for now).
- Type:
float, default=0
- law
Damage law [‘0: analytical’, ‘1: pralong’].
- Type:
float, default=0
- spcdamage
Damage constraints (NaN means no constraint).
- Type:
numpy.ndarray, default=np.nan
- max_damage
Maximum possible damage (0 <= max_damage < 1).
- Type:
float, default=1 - 1e-5
- stabilization
Stabilization method: 0=no stabilization, 1=artificial diffusion, 2=SUPG (not working), 4=flux corrected transport.
- Type:
float, default=4
- maxiter
Maximum number of non-linear iterations.
- Type:
float, default=100
- elementinterp
Interpolation scheme for finite elements [‘P1’, ‘P2’].
- Type:
str, default=’P1’
- stress_threshold
Stress threshold for damage initiation [Pa].
- Type:
float, default=1.3e5
- stress_ubound
Stress upper bound for damage healing [Pa].
- Type:
float, default=np.nan
- kappa
Ductility parameter for stress softening and damage [> 1].
- Type:
float, default=2.8
- c1
Damage parameter 1.
- Type:
float, default=0
- c2
Damage parameter 2.
- Type:
float, default=0
- c3
Damage parameter 3.
- Type:
float, default=0
- c4
Damage parameter 4.
- Type:
float, default=0
- healing
Healing parameter.
- Type:
float, default=0
- equiv_stress
Equivalent stress parameter.
- Type:
float, default=0
- requested_outputs
Additional outputs requested.
- Type:
list, default=[‘default’]
Examples
>>> md.damage = pyissm.model.classes.damage() >>> md.damage.isdamage = 1
- __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 [damage] parameters.
issm_enum_string()Default ISSM C++ enum string used during marshalling.
marshall_class(fid, prefix[, md])Marshall [damage.damage] parameters to a binary file.
- check_consistency(md, solution, analyses)
Check consistency of the [damage] 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:
- marshall_class(fid, prefix, md=None)
Marshall [damage.damage] parameters to a binary file.
- Parameters:
fid (
file object) – The file object to write the binary data to.prefix (
str) – Prefix string used for data identification in the binary file.md (
pyissm.model.Model, optional) – ISSM model object needed in some cases.
- Return type:
None