Basic Model Interface#
landlab.bmi.bmi_bridge module#
Wrap landlab component with the Basic Modeling Interface (landlab.bmi.bmi_bridge
)#
Section author: Eric Hutton
Function reference#
The wrap_as_bmi function wraps a landlab component class so that it exposes a Basic Modelling Interface.
- class TimeStepper(start=0.0, stop=None, step=1.0, units='s')[source]#
Bases:
object
Step through time.
- Parameters:
Examples
>>> from landlab.bmi import TimeStepper >>> time_stepper = TimeStepper() >>> time_stepper.start 0.0 >>> time_stepper.stop is None True >>> time_stepper.step 1.0 >>> time_stepper.time 0.0 >>> for _ in range(10): time_stepper.advance() >>> time_stepper.time 10.0 >>> time_stepper = TimeStepper(1., 13., 2.) >>> [time for time in time_stepper] [1.0, 3.0, 5.0, 7.0, 9.0, 11.0]
- property start#
Start time.
- property step#
Time Step.
- property stop#
Stop time.
- property time#
Current time.
- property units#
Time units.
- wrap_as_bmi(cls)[source]#
Wrap a landlab class so it exposes a BMI.
Give a landlab component a Basic Model Interface (BMI). Since landlab components have an interface that is already in the style of BMI, this function adds just a light wrapping to landlab components. There are a number of differences that may cause some confusion to landlab users.
Because BMI doesn’t have a concept of a dual grid, it only defines nodes (points), edges (vectors), and faces (areas). The dual-graph of landlab is considered as two separate grids by BMI.
It is important to note that BMI has only three grid elements (node, edge, and face) while landlab has 6. The names used by landlab and BMI are also different.
Thus, a BMI-wrapped landlab component will always have two grids with grid identifiers 0, and 1. Grid 0 will contain the landlab nodes, links, and patches while grid 1 will contain corners, faces, and cells.landlab and BMI refer to grid elements by different names. The mapping from landlab to BMI nomenclature is the following:
Grid 0: * node: node * link: edge * patch: face
Grid 1: * corner: node * face: edge * cell: face
In BMI, the initialize method requires an input file that is used to create and setup the model for time-stepping. landlab components generally do not have anything like this; instead this task is usually done programmatically. Thus, the input file that is used by the BMI initialize method is a standard landlab input file as used by the landlab create_grid function.
- Parameters:
cls (class) – A landlab class that inherits from Component.
- Returns:
A wrapped class that exposes a BMI.
- Return type:
class
Examples
>>> from landlab.bmi import wrap_as_bmi >>> from landlab.components.flexure import Flexure
>>> BmiFlexure = wrap_as_bmi(Flexure) >>> flexure = BmiFlexure() >>> sorted(flexure.get_input_var_names()) ['boundary_condition_flag', 'lithosphere__overlying_pressure_increment'] >>> flexure.get_var_units("lithosphere__overlying_pressure_increment") 'Pa'
>>> config = """ ... flexure: ... eet: 10.e+3 ... method: flexure ... clock: ... start: 0. ... stop: 10. ... step: 2. ... grid: ... RasterModelGrid: ... - [20, 40] ... - xy_spacing: [2000., 1000.] ... - fields: ... node: ... lithosphere__overlying_pressure_increment: ... constant: ... - value: 0.0 ... """ >>> flexure.initialize(config) >>> sorted(flexure.get_output_var_names()) ['boundary_condition_flag', 'lithosphere_surface__elevation_increment'] >>> flexure.get_var_grid('lithosphere_surface__elevation_increment') 0 >>> flexure.get_grid_shape(0, np.empty(flexure.get_grid_rank(0), dtype=int)) array([20, 40]) >>> dz = np.empty(flexure.get_grid_size(0)) >>> _ = flexure.get_value('lithosphere_surface__elevation_increment', dz)
>>> np.all(dz == 0.) True >>> flexure.get_current_time() 0.0
>>> sorted(flexure.get_input_var_names()) ['boundary_condition_flag', 'lithosphere__overlying_pressure_increment'] >>> load = np.zeros((20, 40), dtype=float) >>> load[0, 0] = 1. >>> flexure.set_value('lithosphere__overlying_pressure_increment', load) >>> flexure.update() >>> flexure.get_current_time() 2.0 >>> _ = flexure.get_value('lithosphere_surface__elevation_increment', dz) >>> np.all(dz == 0.) False
landlab.bmi.components module#
- class AdvectionSolverTVDBMI#
Bases:
Bmi
Basic Modeling Interface for the AdvectionSolverTVD component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class AreaSlopeTransporterBMI#
Bases:
Bmi
Basic Modeling Interface for the AreaSlopeTransporter component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class BedParcelInitializerAreaBMI#
Bases:
Bmi
Basic Modeling Interface for the BedParcelInitializerArea component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class BedParcelInitializerDepthBMI#
Bases:
Bmi
Basic Modeling Interface for the BedParcelInitializerDepth component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class BedParcelInitializerDischargeBMI#
Bases:
Bmi
Basic Modeling Interface for the BedParcelInitializerDischarge component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class BedParcelInitializerUserD50BMI#
Bases:
Bmi
Basic Modeling Interface for the BedParcelInitializerUserD50 component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class BedrockLandsliderBMI#
Bases:
Bmi
Basic Modeling Interface for the BedrockLandslider component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class CarbonateProducerBMI#
Bases:
Bmi
Basic Modeling Interface for the CarbonateProducer component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class ChannelProfilerBMI#
Bases:
Bmi
Basic Modeling Interface for the ChannelProfiler component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class ChiFinderBMI#
Bases:
Bmi
Basic Modeling Interface for the ChiFinder component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DepressionFinderAndRouterBMI#
Bases:
Bmi
Basic Modeling Interface for the DepressionFinderAndRouter component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DepthDependentDiffuserBMI#
Bases:
Bmi
Basic Modeling Interface for the DepthDependentDiffuser component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DepthDependentTaylorDiffuserBMI#
Bases:
Bmi
Basic Modeling Interface for the DepthDependentTaylorDiffuser component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DepthSlopeProductErosionBMI#
Bases:
Bmi
Basic Modeling Interface for the DepthSlopeProductErosion component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DetachmentLtdErosionBMI#
Bases:
Bmi
Basic Modeling Interface for the DetachmentLtdErosion component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DimensionlessDischargeBMI#
Bases:
Bmi
Basic Modeling Interface for the DimensionlessDischarge component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DischargeDiffuserBMI#
Bases:
Bmi
Basic Modeling Interface for the DischargeDiffuser component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class DrainageDensityBMI#
Bases:
Bmi
Basic Modeling Interface for the DrainageDensity component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class ErosionDepositionBMI#
Bases:
Bmi
Basic Modeling Interface for the ErosionDeposition component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class ExponentialWeathererBMI#
Bases:
Bmi
Basic Modeling Interface for the ExponentialWeatherer component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class ExponentialWeathererIntegratedBMI#
Bases:
Bmi
Basic Modeling Interface for the ExponentialWeathererIntegrated component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class FastscapeEroderBMI#
Bases:
Bmi
Basic Modeling Interface for the FastscapeEroder component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class FireGeneratorBMI#
Bases:
Bmi
Basic Modeling Interface for the FireGenerator component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class Flexure1DBMI#
Bases:
Bmi
Basic Modeling Interface for the Flexure1D component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- get_input_item_count()#
Count of a model’s input variables.
- Returns:
The number of input variables.
- Return type:
- get_input_var_names()#
Names of the input exchange items.
- get_output_item_count()#
Count of a model’s output variables.
- Returns:
The number of output variables.
- Return type:
- get_output_var_names()#
Names of the output exchange items.
- get_start_time()#
Start time of the component.
- get_time_step()#
Component time step.
- get_time_units()#
Time units used by the component.
- get_value(name, dest)#
Get a copy of a variable’s data.
- get_value_at_indices(name, dest, inds)#
Get values at particular indices.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
dest (ndarray) – A numpy array into which to place the values.
indices (array_like) – The indices into the variable array.
- Returns:
Value of the model variable at the given location.
- Return type:
array_like
- get_value_ptr(name)#
Get a reference to values of the given variable.
This is a getter for the model, used to access the model’s current state. It returns a reference to a model variable, with the return type, size and rank dependent on the variable.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
A reference to a model variable.
- Return type:
array_like
- get_value_ref(name)#
Get a reference to a variable’s data.
- get_var_grid(name)#
Get the grid id for a variable.
- get_var_itemsize(name)#
Get the size of elements of a variable.
- get_var_location(name)#
Get the grid element type that the a given variable is defined on.
The grid topology can be composed of nodes, edges, and faces.
- node
A point that has a coordinate pair or triplet: the most basic element of the topology.
- edge
A line or curve bounded by two nodes.
- face
A plane or surface enclosed by a set of edges. In a 2D horizontal application one may consider the word “polygon”, but in the hierarchy of elements the word “face” is most common.
- Parameters:
name (str) – An input or output variable name, a CSDMS Standard Name.
- Returns:
The grid location on which the variable is defined. Must be one of “node”, “edge”, or “face”.
- Return type:
Notes
CSDMS uses the ugrid conventions to define unstructured grids.
- get_var_nbytes(name)#
Get the total number of bytes used by a variable.
- get_var_type(name)#
Get the data type for a variable.
- get_var_units(name)#
Get the unit used by a variable.
- initialize(config_file)#
Initialize the component from a file.
BMI-wrapped Landlab components use input files in YAML format. Component-specific parameters are listed at the top level, followed by grid and then time information. An example input file looks like:
flexure: eet: 15.e+3 clock: start: 0 stop: 100. step: 2. grid: type: raster shape: [20, 40] spacing: [1000., 2000.]
In this case, a RasterModelGrid is created (with the given shape and spacing) and passed to the underlying landlab component. The eet=15000. is also given to the component but as a keyword parameter. The BMI clock is initialized with the given parameters.
- Parameters:
config_file (str or file_like) – YAML-formatted input file for the component.
- set_value(name, values)#
Set the values of a variable.
- set_value_at_indices(name, inds, src)#
Specify a new value for a model variable at particular indices.
- Parameters:
var_name (str) – An input or output variable name, a CSDMS Standard Name.
indices (array_like) – The indices into the variable array.
src (array_like) – The new value for the specified variable.
- update()#
Update the component one time step.
- update_frac(frac)#
Update the component a fraction of a time step.
- update_until(then)#
Update the component until a given time.
- class FlexureBMI#
Bases:
Bmi
Basic Modeling Interface for the Flexure component.
- finalize()#
Clean-up the component.
- get_component_name()#
Name of the component.
- get_current_time()#
Current component time.
- get_end_time()#
Stop time for the component.
- get_grid_edge_count(grid)#
Get the number of edges in the grid.
- get_grid_edge_nodes(grid, edge_nodes)#
Get the edge-node connectivity.
- Parameters:
grid (int) – A grid identifier.
edge_nodes (ndarray of int, shape (2 x nnodes,)) – A numpy array to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Returns:
The input numpy array that holds the edge-node connectivity.
- Return type:
ndarray of int
- get_grid_face_count(grid)#
Get the number of faces in the grid.
- get_grid_face_edges(grid)#
Get the face-edge connectivity.
- get_grid_face_nodes(grid, face_nodes)#
Get the face-node connectivity.
- Parameters:
- Returns:
The input numpy array that holds the face-node connectivity.
- Return type:
ndarray of int
- get_grid_node_count(grid)#
Get the number of nodes in the grid.
- get_grid_nodes_per_face(grid, nodes_per_face)#
Get the number of nodes for each face.
- get_grid_origin(grid, origin)#
Get the origin for a structured grid.
- get_grid_rank(grid)#
Get the number of dimensions of a grid.
- get_grid_shape(grid, shape)#
Get the shape of a structured grid.
- get_grid_size(grid)#
Get the total number of elements in the computational grid.
- get_grid_spacing(grid, spacing)#
Get the row and column spacing of a structured grid.
- get_grid_type(grid)#
Get the type of grid.
- get_grid_x(grid, x)#
Get coordinates of grid nodes in the x direction.
- get_grid_y(grid, y)#
Get coordinates of grid nodes in the y direction.
- get_grid_z(grid, z)#
Get coordinates of grid nodes in the z direction.
- Parameters:
grid (int) – A grid identifier.
z (ndarray of float, shape (nlayers,)) – A numpy array to hold the z-coordinates of the grid nodes layers.
- Returns:
The input numpy array that holds the grid’s layer z-coordinates.
- Return type: