landlab.components.network_sediment_transporter.sediment_pulser_base¶
- class SedimentPulserBase[source]¶
Bases:
Component
Base class of
SedimentPulserAtLinks
andSedimentPulserEachParcel
.SedimentPulserAtLinks
andSedimentPulserEachParcel
run the landlabDataRecord
add_item
method on aDataRecord
configured forNetworkSedimentTransporter
.- Parameters:
grid (ModelGrid) – landlab ModelGrid to place sediment parcels on.
parcels (landlab DataRecord) – Tracks parcel location and variables
D50 (float, optional) – median grain size [m]
D84_D50 (float, optional) – ratio of 84th percentile grain size to the median grain size
rho_sediment (float, optional) – Sediment grain density [kg / m^3].
parcel_volume (float, optional) – parcel volume used for all parcels that do not have a specified volume
abrasion_rate (float, optional) – volumetric abrasion exponent [1/m]
Examples
>>> import numpy as np >>> from landlab import NetworkModelGrid
>>> y_of_node = (0, 100, 200, 200, 300, 400, 400, 125) >>> x_of_node = (0, 0, 100, -50, -100, 50, -150, -100) >>> nodes_at_link = ((1, 0), (2, 1), (1, 7), (3, 1), (3, 4), (4, 5), (4, 6)) >>> grid = NetworkModelGrid((y_of_node, x_of_node), nodes_at_link) >>> grid.at_link["channel_width"] = np.full(grid.number_of_links, 1.0) # m >>> grid.at_link["channel_slope"] = np.full(grid.number_of_links, 0.01) # m / m >>> grid.at_link["reach_length"] = np.full(grid.number_of_links, 100.0) # m >>> make_pulse_base = SedimentPulserBase(grid) >>> make_pulse_base._parcels
SedimentPulserBase does not have any methods for adding a pulse
>>> a_pulse = make_pulse_base() Traceback (most recent call last): ... NotImplementedError: the base component has no call method
- __init__(grid, parcels=None, D50=0.05, D84_D50=2.1, rho_sediment=2650.0, parcel_volume=0.5, abrasion_rate=0.0)[source]¶
- static __new__(cls, *args, **kwds)¶
- cite_as = ''¶
- property coords¶
Return the coordinates of nodes on grid attached to the component.
- property current_time¶
Current time.
Some components may keep track of the current time. In this case, the
current_time
attribute is incremented. Otherwise it is set to None.- Return type:
current_time
- definitions = ()¶
- classmethod from_path(grid, path)¶
Create a component from an input file.
- property grid¶
Return the grid attached to the component.
- initialize_optional_output_fields()¶
Create fields for a component based on its optional field outputs, if declared in _optional_var_names.
This method will create new fields (without overwrite) for any fields output by the component as optional. New fields are initialized to zero. New fields are created as arrays of floats, unless the component also contains the specifying property _var_type.
- initialize_output_fields(values_per_element=None)¶
Create fields for a component based on its input and output var names.
This method will create new fields (without overwrite) for any fields output by, but not supplied to, the component. New fields are initialized to zero. Ignores optional fields. New fields are created as arrays of floats, unless the component specifies the variable type.
- Parameters:
values_per_element (int (optional)) – On occasion, it is necessary to create a field that is of size (n_grid_elements, values_per_element) instead of the default size (n_grid_elements,). Use this keyword argument to acomplish this task.
- input_var_names = ()¶
- name = 'SedimentPulserBase'¶
- optional_var_names = ()¶
- output_var_names = ()¶
- property shape¶
Return the grid shape attached to the component, if defined.
- unit_agnostic = False¶
- units = ()¶
- classmethod var_definition(name)¶
Get a description of a particular field.
- Parameters:
name (str) – A field name.
- Returns:
A description of each field.
- Return type:
tuple of (name, *description*)
- classmethod var_help(name)¶
Print a help message for a particular field.
- Parameters:
name (str) – A field name.
- classmethod var_loc(name)¶
Location where a particular variable is defined.
- var_mapping = ()¶