landlab.components.gflex.flexure

This is a Landlab wrapper for A Wickert’s gFlex flexure model (Wickert et al., submitted to Geoscientific Model Development). The most up-to-date version of his code can be found at github.com/awickert/gFlex.

This Landlab wrapper will use a snapshot of that code, which YOU need to install on your own machine. A stable snapshot of gFlex is hosted on PyPI, which is the recommended version to install. If you have pip (the Python package install tool), simply run ‘pip install gFlex’ from a command prompt. Alternatively, you can download and unpack the code (from github, or with PyPI, pypi.python.org/pypi/gFlex/), then run ‘python setup.py install’.

Created on Thu Feb 19 18:47:11 2015

@author: daniel.hobley (SiccarPoint @Github)

…following AW’s run_in_script_2D.py.

class gFlex[source]

Bases: Component

This is a Landlab wrapper for A Wickert’s gFlex flexure model (Wickert et al., 2016, Geoscientific Model Development). The most up-to-date version of his code can be found at github.com/awickert/gFlex.

This Landlab wrapper will use a snapshot of that code, which YOU need to install on your own machine. A stable snapshot of gFlex is hosted on PyPI, which is the recommended version to install. If you have pip (the Python package install tool), simply run ‘pip install gFlex’ from a command prompt. Alternatively, you can download and unpack the code (from github, or with PyPI, pypi.python.org/pypi/gFlex/), then run ‘python setup.py install’.

Note that gFlex maintains its own internal version if the grid, but this should not affect performance.

This component will modify the topographic__elevation field only if one already exists. Note that the gFlex component demands lengths in meters, including the grid dimensions. The component also recognises the gFlex specific parameters ‘Method’, ‘PlateSolutionType’, ‘Solver’, and ‘Quiet’. See the gFlex software documentation for more details.

Examples

NB: these tests are not actually run as our automated testing becomes confused if gFlex is not installed on the testing machine!

>>> from landlab import RasterModelGrid
>>> from landlab.components import gFlex
>>> mg = RasterModelGrid((10, 10), xy_spacing=25000.0)
>>> z = mg.add_zeros("topographic__elevation", at="node", dtype=float)
>>> stress = mg.add_zeros("surface_load__stress", at="node", dtype=float)
>>> stress.view().reshape(mg.shape)[3:7, 3:7] += 1.0e6
>>> gf = gFlex(
...     mg, BC_E="0Moment0Shear", BC_N="Periodic", BC_S="Periodic"
... )  
>>> gf.run_one_step()  

N-S profile across flexed plate:

>>> z.reshape(mg.shape)[:, 5]  
array([-4.54872677, -4.6484927 , -4.82638669, -5.03001546, -5.15351385,
       -5.15351385, -5.03001546, -4.82638669, -4.6484927 , -4.54872677])

W-E profile, noting the free BC to the east side:

>>> z.reshape(mg.shape)[5, :]  
array([-0.43536739, -1.19197738, -2.164915  , -3.2388464 , -4.2607558 ,
       -5.15351385, -5.89373366, -6.50676947, -7.07880156, -7.63302576])

References

Required Software Citation(s) Specific to this Component

Wickert, A. (2016). Open-source modular solutions for flexural isostasy: gFlex v1.0. Geoscientific Model Development 9(3), 997-1017. https://dx.doi.org/10.5194/gmd-9-997-2016

Additional References

None Listed

Constructor for Wickert’s gFlex in Landlab.

Parameters:
  • Youngs_modulus (float) – Young’s modulus for the lithosphere.

  • Poissons_ratio (float) – Poisson’s ratio for the lithosphere.

  • rho_mantle (float (kg*m**-3)) – The density of the mantle.

  • rho_fill (float (kg*m**-3)) – The density of the infilling material (air, water…)

  • elastic_thickness (float (m)) – The elastic thickness of the lithosphere.

  • BC_W ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_E ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_N ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_S ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • g (float (m*s**-2)) – The acceleration due to gravity.

__init__(grid, Youngs_modulus=650000000000.0, Poissons_ratio=0.25, rho_mantle=3300.0, rho_fill=0.0, elastic_thickness=35000.0, Method='FD', Solver='direct', PlateSolutionType='vWC1994', quiet=True, BC_W='0Displacement0Slope', BC_E='0Displacement0Slope', BC_N='0Displacement0Slope', BC_S='0Displacement0Slope', g=scipy.constants.g)[source]

Constructor for Wickert’s gFlex in Landlab.

Parameters:
  • Youngs_modulus (float) – Young’s modulus for the lithosphere.

  • Poissons_ratio (float) – Poisson’s ratio for the lithosphere.

  • rho_mantle (float (kg*m**-3)) – The density of the mantle.

  • rho_fill (float (kg*m**-3)) – The density of the infilling material (air, water…)

  • elastic_thickness (float (m)) – The elastic thickness of the lithosphere.

  • BC_W ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_E ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_N ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • BC_S ({'0Displacement0Slope', '0Moment0Shear',) – ‘Periodic’} The boundary condition status of each grid edge, following gFlex’s definitions. Periodic boundaries must be paired (obviously).

  • g (float (m*s**-2)) – The acceleration due to gravity.

static __new__(cls, *args, **kwds)
cite_as = '\n    @article{wickert2016open,\n      author = {Wickert, A. D.},\n      title = {{Open-source modular solutions for flexural isostasy: gFlex v1.0}},\n      issn = {1991-959X},\n      doi = {10.5194/gmd-9-997-2016},\n      pages = {997--1017},\n      number = {3},\n      volume = {9},\n      journal = {Geoscientific Model Development},\n      year = {2016}\n    }\n    '
property coords

Return the coordinates of nodes on grid attached to the component.

property current_time

Current time.

Some components may keep track of the current time. In this case, the current_time attribute is incremented. Otherwise it is set to None.

Return type:

current_time

definitions = (('lithosphere_surface__elevation_increment', 'The change in elevation of the top of the lithosphere (the land surface) in one timestep'), ('surface_load__stress', 'Magnitude of stress exerted by surface load'), ('topographic__elevation', 'Land surface topographic elevation'))
flex_lithosphere()[source]

Executes (& finalizes, from the perspective of gFlex) the core method of gFlex.

Note that flexure of the lithosphere proceeds to steady state in a single timestep.

classmethod from_path(grid, path)

Create a component from an input file.

Parameters:
  • grid (ModelGrid) – A landlab grid.

  • path (str or file_like) – Path to a parameter file, contents of a parameter file, or a file-like object.

Returns:

A newly-created component.

Return type:

Component

property grid

Return the grid attached to the component.

initialize_optional_output_fields()

Create fields for a component based on its optional field outputs, if declared in _optional_var_names.

This method will create new fields (without overwrite) for any fields output by the component as optional. New fields are initialized to zero. New fields are created as arrays of floats, unless the component also contains the specifying property _var_type.

initialize_output_fields(values_per_element=None)

Create fields for a component based on its input and output var names.

This method will create new fields (without overwrite) for any fields output by, but not supplied to, the component. New fields are initialized to zero. Ignores optional fields. New fields are created as arrays of floats, unless the component specifies the variable type.

Parameters:

values_per_element (int (optional)) – On occasion, it is necessary to create a field that is of size (n_grid_elements, values_per_element) instead of the default size (n_grid_elements,). Use this keyword argument to acomplish this task.

input_var_names = ('surface_load__stress',)
name = 'gFlex'
optional_var_names = ()
output_var_names = ('lithosphere_surface__elevation_increment', 'topographic__elevation')
run_one_step()[source]

Flex the lithosphere to find its steady state form.

The standardized run method for this component.

Parameters:

None

property shape

Return the grid shape attached to the component, if defined.

unit_agnostic = True
units = (('lithosphere_surface__elevation_increment', 'm'), ('surface_load__stress', 'Pa'), ('topographic__elevation', 'm'))
classmethod var_definition(name)

Get a description of a particular field.

Parameters:

name (str) – A field name.

Returns:

A description of each field.

Return type:

tuple of (name, *description*)

classmethod var_help(name)

Print a help message for a particular field.

Parameters:

name (str) – A field name.

classmethod var_loc(name)

Location where a particular variable is defined.

Parameters:

name (str) – A field name.

Returns:

The location (‘node’, ‘link’, etc.) where a variable is defined.

Return type:

str

var_mapping = (('lithosphere_surface__elevation_increment', 'node'), ('surface_load__stress', 'node'), ('topographic__elevation', 'node'))
classmethod var_type(name)

Returns the dtype of a field (float, int, bool, str…).

Parameters:

name (str) – A field name.

Returns:

The dtype of the field.

Return type:

dtype

classmethod var_units(name)

Get the units of a particular field.

Parameters:

name (str) – A field name.

Returns:

Units for the given field.

Return type:

str