2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
NeumannBoundary_list Class Reference

Provides fast access to Neumann boundaries for flux update. More...

Detailed Description

Provides fast access to Neumann boundaries for flux update.

If many Neumann boundary conditions are present in a project, a fast data exchange to update the fluxes might be needed.

With this specialized list a num_array can be passed to the boundary conditions for a fast flux update If a multiple system layout for the cmf setup is chosen, we might have a node_list Dirichlet boundary conditions (dbc), a corresponding NeumannBoundary_list (nbc) of Neumann boundaries and a node_list containing the storages connected with the NeumannBoundary_list (storages). The fast data exchange is written in Python as:

# Update the fluxes at the Neumann boundary conditions with net fluxes at the Dirichlet boundary conditions
nbc.fluxes = dbc.water_balance(t)
# Update the potentials at the Dirichlet boundary conditions
dbc.potentials = storages.potentials

Public Member Functions

void append (NeumannBoundary::ptr nbc)
 Appends a neumann boundary to this list.
 
NeumannBoundary::ptr get (ptrdiff_t index) const
 Returns the Neumann boundary condition at position index.
 
cmf::math::num_array get_fluxes (cmf::math::Time t=cmf::math::Time()) const
 Returns the fluxes of the items as an array.
 
real global_water_balance (cmf::math::Time t) const
 Returns the sum of the water balances of the nodes.
 
void set_fluxes (cmf::math::num_array values)
 Sets the fluxes of the items from an array.
 
size_t size () const
 returns the number of stored boundary conditions
 
cmf::water::node_list to_node_list () const
 Creates a node_list from this NeumannBoundary_list.
 
cmf::math::num_array water_balance (cmf::math::Time t) const
 Returns the water balance of each vector as a vector.
 

Member Function Documentation

◆ get()

NeumannBoundary::ptr get ( ptrdiff_t index) const

Returns the Neumann boundary condition at position index.

From Python you can use []

◆ get_fluxes()

Returns the fluxes of the items as an array.

get_fluxes and set_fluxes are wrapped with the Python property fluxes

◆ global_water_balance()

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:

sum=0
for n in nodes:
sum+=n.water_balance(t)

◆ set_fluxes()

void set_fluxes ( cmf::math::num_array values)

Sets the fluxes of the items from an array.

get_fluxes and set_fluxes are wrapped with the Python property fluxes

◆ water_balance()

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:

balances=[n.water_balance(t) for n in nodes]