pyissm.model.Model

class pyissm.model.Model

Bases: object

High-level container for all components of an Ice-sheet and Sea-level System Model (ISSM) model. Initializes a collection of model components, each of which may store inputs, settings, and results related to ice sheet simulation.

mesh

Mesh properties.

Type:

classes.mesh.mesh2d

mask

Defines grounded and floating elements.

Type:

classes.mask

geometry

Surface elevation, bedrock topography, ice thickness, etc.

Type:

classes.geometry

constants

Physical constants.

Type:

classes.constants

smb

Surface mass balance.

Type:

classes.smb.default

basalforcings

Bed forcings.

Type:

classes.basalforcings.default

materials

Material properties.

Type:

classes.materials.ice

damage

Damage propagation laws.

Type:

classes.damage

friction

Basal friction / drag properties.

Type:

classes.friction.default

flowequation

Flow equations.

Type:

classes.flowequation

timestepping

Timestepping for transient models.

Type:

classes.timestepping.default

initialization

Initial guess / state.

Type:

classes.initialization

rifts

Rifts properties.

Type:

classes.rifts

solidearth

Solidearth inputs and settings.

Type:

classes.solidearth.earth

dsl

Dynamic sea level.

Type:

classes.dsl.default

debug

Debugging tools (valgrind, gprof).

Type:

classes.debug

verbose

Verbosity level in solve.

Type:

classes.verbose

settings

Settings properties.

Type:

classes.issmsettings

toolkits

Toolkit options for each solution.

Type:

classes.toolkits

cluster

Cluster parameters (number of CPUs, etc.).

Type:

classes.cluster.generic

balancethickness

Parameters for balancethickness solution.

Type:

classes.balancethickness

stressbalance

Parameters for stressbalance solution.

Type:

classes.stressbalance

groundingline

Parameters for groundingline solution.

Type:

classes.groundingline

hydrology

Parameters for hydrology solution.

Type:

classes.hydrology.shreve

masstransport

Parameters for masstransport solution.

Type:

classes.masstransport

thermal

Parameters for thermal solution.

Type:

classes.thermal

steadystate

Parameters for steadystate solution.

Type:

classes.steadystate

transient

Parameters for transient solution.

Type:

classes.transient

levelset

Parameters for moving boundaries (level-set method).

Type:

classes.levelset

calving

Parameters for calving.

Type:

classes.calving.default

frontalforcings

Parameters for frontalforcings.

Type:

classes.frontalforcings.default

love

Parameters for love solution.

Type:

classes.love.default

esa

Parameters for elastic adjustment solution.

Type:

classes.esa

sampling

Parameters for stochastic sampler.

Type:

classes.sampling

autodiff

Automatic differentiation parameters.

Type:

classes.autodiff

inversion

Parameters for inverse methods.

Type:

classes.inversion.default

qmu

Dakota properties.

Type:

classes.qmu.default

amr

Adaptive mesh refinement properties.

Type:

classes.amr

results

Model results.

Type:

classes.results.default

outputdefinition

Output definition.

Type:

classes.outputdefinition

radaroverlay

Radar image for plot overlay.

Type:

classes.radaroverlay

miscellaneous

Miscellaneous fields.

Type:

classes.miscellaneous

stochasticforcing

Stochasticity applied to model forcings.

Type:

classes.stochasticforcing

Examples

>>> md = pyissm.model.Model()
>>> md.mesh
<mesh object>
>>> md.mask
<mask object>
>>> md.geometry
<geometry object>
__init__()

Initialize default sub-classes and parameterizations for the ISSM model object.

This constructor initializes all default model components and their associated classes, setting up the complete structure for an Ice-sheet and Sea-level System Model (ISSM) simulation.

Notes

All attributes are initialized with their default class implementations. See the class docstring for detailed descriptions of each attribute.

Methods

__init__()

Initialize default sub-classes and parameterizations for the ISSM model object.

check_message(string)

Notify about a model consistency error, update internal state, and return the instance.

collapse()

Collapse a 3D mesh into a 2D mesh.

extract(area)

Extract a submodel from a larger model based on a domain or flag list.

extrude([num_layers, extrusion_exponent, ...])

Vertically extrude a 2D mesh to create a 3D mesh.

model_class_names()

Return a sorted list of registered model class attribute names.

check_message(string)

Notify about a model consistency error, update internal state, and return the instance.

This method prints a formatted consistency error message to standard output, marks the instance as inconsistent by setting self.private.isconsistent, and returns the instance to allow for method chaining.

Parameters:

string (str) – Human-readable description of the consistency error. This will be inserted into the printed message: Model consistency error: {string}.

Returns:

The same instance on which the method was called, enabling fluent/chained calls.

Return type:

self

Notes

This method mutates the instance state (self.private.isconsistent) and prints output. It does not raise exceptions.

Examples

>>> obj.check_message("missing parameter")
    Model consistency error: missing parameter
>>> obj.private.isconsistent
    False
collapse()

Collapse a 3D mesh into a 2D mesh.

This method collapses a 3D model into a 2D model by depth-averaging all fields. The original 3D mesh information is preserved, but the model is modified in-place.

The following operations are performed:

  • Projects 3D friction coefficients to 2D (at bedrock level)

  • Averages or projects 3D observations and initialization fields to 2D

  • Collapses boundary conditions from 3D to 2D

  • Depth-averages velocity and material properties

  • Projects 3D results and output definitions to 2D

  • Rebuilds mesh connectivity for the 2D mesh

Returns:

md – The same model instance with updated 2D mesh and collapsed fields. Original 3D mesh information is preserved.

Return type:

pyissm.model.Model

Raises:

Exception

  • If the model does not contain a 3D mesh. - If an unsupported friction type is encountered.

Notes

This method modifies the model in-place. All 3D fields are projected or averaged to create 2D equivalents.

Examples

>>> md = pyissm.model.Model()
>>> md.collapse()

See also

pyissm.model.Model.extract()

Extract sub-model from larger domain

pyissm.model.Model.extrude()

Extrude model in vertical direction

extract(area)

Extract a submodel from a larger model based on a domain or flag list.

This routine extracts a submodel from a bigger model with respect to a given contour. The contour must be followed by the corresponding .exp file or a flags list. It can either be a domain file (argus type, .exp extension), or an array of element flags. If the user wants every element outside the domain to be extracted, add ‘~’ to the name of the domain file (e.g., ‘~HO.exp’). An empty string ‘’ will be considered as an empty domain. A string ‘all’ will be considered as the entire domain.

The function performs the following operations:

  • Flags elements inside the specified area

  • Removes elements with all three nodes in excluded regions

  • Renumbers elements and nodes to maintain consistency

  • Updates mesh connectivity and vertex information

  • Adjusts boundary conditions at extraction boundaries

  • Handles 2D/3D mesh types and their specific properties

  • Processes results and output definitions if present

Parameters:

area (str or array_like) –

Domain specification. Can be:

  • A domain file path (str - Argus file time, with .exp extension)

  • A domain file path prefixed with ‘~’ to invert the domain

  • An array of element flags (bool or int)

  • An empty string ‘’ for empty domain

  • The string ‘all’ for entire domain

Returns:

md2 – Extracted submodel containing only the elements and nodes within the specified area. The model includes updated mesh properties, renumbered elements and nodes, adjusted boundary conditions, and extracted results and output definitions if present.

Return type:

pyissm.model.Model

Raises:

RuntimeError

  • If the extracted model is empty (no elements found in the specified area).

Examples

>>> md2 = md.extract('Domain.exp')
>>> md3 = md.extract('~Domain.exp')  # Extract outside domain
>>> md4 = md.extract(flag_array)     # Extract based on flag array

See also

pyissm.model.Model.extrude()

Extrude model in vertical direction

pyissm.model.Model.collapse()

Collapse model layers

extrude(num_layers=None, extrusion_exponent=None, lower_exponent=None, upper_exponent=None, coefficients=None)

Vertically extrude a 2D mesh to create a 3D mesh.

Vertically extrude a 2D mesh and create corresponding 3D prism mesh. The vertical distribution can follow a polynomial law, two polynomial laws (one for lower part and one for upper part), or be described by a list of coefficients between 0 and 1.

Parameters:
  • num_layers (int, optional) – Number of vertical layers to create. Required when using polynomial extrusion (single or dual exponent). Must be at least 2.

  • extrusion_exponent (float, optional) – Single polynomial exponent for uniform vertical distribution. Must be >= 0. When specified, creates extrusion list using this exponent.

  • lower_exponent (float, optional) – Polynomial exponent for the lower part of the mesh. Must be >= 0. Used in conjunction with upper_exponent for non-uniform vertical distribution.

  • upper_exponent (float, optional) – Polynomial exponent for the upper part of the mesh. Must be >= 0. Used in conjunction with lower_exponent for non-uniform vertical distribution.

  • coefficients (array_like, optional) – List of coefficients between 0 and 1 defining custom vertical distribution. Automatically includes 0 and 1 if not present. Alternative to polynomial extrusion.

Returns:

md – The same model instance with updated 3D mesh and extruded model fields. Original 2D mesh is preserved in mesh.x2d, mesh.y2d, mesh.elements2d, etc.

Return type:

pyissm.model.Model

Raises:

TypeError

  • If extrusion_exponent or lower_exponent/upper_exponent <= 0. - If coefficients contain values outside [0, 1] range. - If num_layers < 2. - If mesh is already 3D (extrude called more than once).

Notes

The function performs the following operations:

  • Creates 3D prism elements from 2D elements

  • Distributes nodes vertically between bed and surface according to extrusion parameters

  • Maintains vertex and element numbering relationships via lowervertex,

uppervertex, lowerelements, and upperelements - Projects all 2D model fields to 3D using extrude methods - Updates mesh connectivity and boundary information - Preserves the original 2D mesh information for reference

Examples

Single exponent (uniform-like distribution):

>>> md = md.extrude(num_layers=15, extrusion_exponent=1.3)

Dual exponents (non-uniform distribution):

>>> md = md.extrude(num_layers=15, lower_exponent=1.3, upper_exponent=1.2)

Custom coefficients (specific layer distribution):

>>> md = md.extrude(coefficients=[0, 0.2, 0.5, 0.7, 0.9, 0.95, 1])

See also

pyissm.model.Model.extract()

Extract sub-model from larger domain

pyissm.model.Model.collapse()

Collapse model layers

model_class_names()

Return a sorted list of registered model class attribute names.

The method inspects the instance attributes and returns those whose classes are registered in classes.class_registry.CLASS_REGISTRY.

Returns:

Sorted list of attribute names corresponding to registered model classes.

Return type:

list of str

Examples

>>> md.model_class_names()
['amr', 'autodiff', 'balancethickness', 'basalforcings', 'calving', 'cluster', 'constants',
'damage', 'debris', 'debug', 'dsl', 'esa', 'flowequation', 'friction', 'frontalforcings',
'geometry', 'groundingline', 'hydrology', 'initialization', 'inversion', 'levelset', 'love',
'mask', 'masstransport', 'materials', 'mesh', 'miscellaneous', 'outputdefinition', 'private',
'qmu', 'radaroverlay', 'results', 'rifts', 'sampling', 'settings', 'smb', 'solidearth', 'steadystate',
'stochasticforcing', 'stressbalance', 'thermal', 'timestepping', 'toolkits', 'transient', 'verbose']