pyissm.model.classes.flowequation

class pyissm.model.classes.flowequation(other=None)

Bases: manage_state

Flow equation class for ISSM.

This class contains parameters for configuring flow equations in the ISSM framework. It allows users to select and configure different ice flow approximations such as SIA, SSA, Higher-Order, and Full-Stokes, along with their associated numerical methods and boundary conditions.

Parameters:

other (any, optional) – Any other class object that contains common fields to inherit from. If values in other differ from default values, they will override the default values.

isSIA

Is the Shallow Ice Approximation (SIA) used?

Type:

int, default=0

isL1L2

Are L1L2 equations used?

Type:

int, default=0

isSSA

Is the Shelfy-Stream Approximation (SSA) used?

Type:

int, default=0

isMOLHO

Are MOno-layer Higher-Order (MOLHO) equations used?

Type:

int, default=0

isHO

Is the Higher-Order (HO) approximation used?

Type:

int, default=0

isFS

Are the Full-Stokes (FS) equations used?

Type:

int, default=0

isNitscheBC

Is weakly imposed condition used?

Type:

int, default=0

FSNitscheGamma

Gamma value for the Nitsche term.

Type:

float, default=1e6

fe_SSA

Finite Element for SSA: ‘P1’, ‘P1bubble’, ‘P1bubblecondensed’, ‘P2’.

Type:

str, default=’P1’

fe_HO

Finite Element for HO: ‘P1’, ‘P1bubble’, ‘P1bubblecondensed’, ‘P2’.

Type:

str, default=’P1’

fe_FS

Finite Element for FS: ‘MINI’, ‘MINIcondensed’, ‘TaylorHood’, ‘XTaylorHood’, ‘OneLayerP4z’, ‘CrouzeixRaviart’.

Type:

str, default=’MINIcondensed’

augmented_lagrangian_r

Augmented Lagrangian parameter r.

Type:

float, default=1

augmented_lagrangian_rhop

Augmented Lagrangian parameter rhop.

Type:

float, default=1

augmented_lagrangian_rlambda

Augmented Lagrangian parameter rlambda.

Type:

float, default=1

augmented_lagrangian_rholambda

Augmented Lagrangian parameter rholambda.

Type:

float, default=1

XTH_theta

XTH theta parameter.

Type:

float, default=0

vertex_equation

Vertex equation parameter.

Type:

float, default=np.nan

element_equation

Element equation parameter.

Type:

float, default=np.nan

borderSSA

Border parameter for SSA.

Type:

float, default=np.nan

borderHO

Border parameter for HO.

Type:

float, default=np.nan

borderFS

Border parameter for FS.

Type:

float, default=np.nan

Examples

>>> md.flowequation = pyissm.model.classes.flowequation()
>>> md.flowequation.isSSA = 1
>>> md.flowequation.fe_SSA = 'P1bubble'
>>> md.flowequation.FSNitscheGamma = 1e5
__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:

  1. Iterates through all attributes of the current instance

  2. Checks if the same attribute exists in the ‘other’ instance

  3. Compares field values using _fields_equal()

  4. 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 [flowequation.default] parameters.

issm_enum_string()

Default ISSM C++ enum string used during marshalling.

marshall_class(fid, prefix[, md])

Marshall [flowequation.default] parameters to a binary file.

check_consistency(md, solution, analyses)

Check consistency of the [flowequation.default] 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:

pyissm.model.Model

marshall_class(fid, prefix, md=None)

Marshall [flowequation.default] 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