2.0.0b10
catchment modelling framework
|
A collection of nodes for fast access of the waterbalance. More...
A collection of nodes for fast access of the waterbalance.
In setups with many storages and rather fast computations, the speed of data access for output generation can take a high portion of the total run time. To accelerate data access, one can use the node_list object
Public Member Functions | |
node_list () | |
Creates an empty node_lust | |
node_list (const cmf::water::node_list &forcopy) | |
Copy the node_list. | |
void | append (flux_node::ptr node) |
Adds a flux node to the list. | |
cmf::math::num_array | conc (cmf::math::Time t, const cmf::water::solute &_Solute) const |
Returns an array holding the concentration of all the flux nodes for the given solute. | |
flux_node::ptr | get (ptrdiff_t index) const |
Returns a node in the node_list. | |
cmf::geometry::point_vector | get_fluxes3d (cmf::math::Time t) const |
Returns the current flow vector for each node. | |
cmf::geometry::point_vector | get_fluxes3d_to (const cmf::water::node_list &targets, cmf::math::Time t) const |
Returns the flux vectors to the nodes of a given target node_list. | |
cmf::math::num_array | get_fluxes_to (const cmf::water::node_list &targets, cmf::math::Time t) const |
A fast method to perform flux queries as a batch. | |
cmf::geometry::point_vector | get_positions () const |
Returns the positions of the nodes. | |
cmf::math::num_array | get_potentials (cmf::math::Time t=cmf::math::never) |
Returns the potential of the nodes. | |
node_list | getslice (ptrdiff_t begin, ptrdiff_t end, ptrdiff_t step=1) const |
Returns a slice of the node_list. | |
real | global_water_balance (cmf::math::Time t) const |
Returns the sum of the water balances of the nodes. | |
operator cmf::math::state_list () | |
Implements StateVariableOwner. | |
cmf::water::node_list | operator+ (const cmf::water::node_list &right) const |
Returns the union of two node_lists. | |
node_list & | operator+= (const cmf::water::node_list &right) |
Extends the node_list with another. | |
bool | remove (flux_node::ptr node) |
Removes a flux node from the list, returns true if successful. | |
ptrdiff_t | set_potentials (const cmf::math::num_array &potentials) |
Sets the potentials of the node_list. | |
size_t | size () const |
The number of nodes. | |
cmf::math::num_array | water_balance (cmf::math::Time t) const |
Returns the water balance of each vector as a vector. | |
cmf::math::num_array get_fluxes_to | ( | const cmf::water::node_list & | targets, |
cmf::math::Time | t ) const |
A fast method to perform flux queries as a batch.
The node lists left and right should have the same length.
targets | A node_list containing the source nodes |
t | The time for the fluxes |
Replaces slow Python code like:
real global_water_balance | ( | cmf::math::Time | t | ) | const |
Returns the sum of the water balances of the nodes.
\[\sigma_{global} = \sum_{i=0}^N{\sum_{j=0}^{C_i}{q_{ij}(t)}} \]
Replaces slow Python code like:
ptrdiff_t set_potentials | ( | const cmf::math::num_array & | potentials | ) |
Sets the potentials of the node_list.
If nodes do not have changeable potentials, they are skipped silently
cmf::math::num_array water_balance | ( | cmf::math::Time | t | ) | const |
Returns the water balance of each vector as a vector.
\[ \sigma_i = \sum_{j=0}^{C_i}{q_{ij}(t)} \]
Replaces slow Python code like: