2.0.0b10
catchment modelling framework
|
The study area, holding all cells, outlets and streams. More...
The study area, holding all cells, outlets and streams.
Public Member Functions | |
project (std::string solute_names="") | |
Creates a new project. | |
upslope::Cell & | get_cell (ptrdiff_t index) |
Returns the reference to the cell at index in the project. | |
const upslope::cell_vector & | get_cells () const |
Returns the cells in the project. | |
cmf::water::flux_node::ptr | get_node (ptrdiff_t index) |
Returns the node from the project nodes at index. | |
cmf::river::Reach::ptr | get_reach (ptrdiff_t index) |
Returns the reach at index. | |
cmf::water::node_list | get_storages () |
Returns a list of all storages of this project. | |
cmf::upslope::Cell * | NewCell (double x, double y, double z, double area, bool with_surfacewater=false) |
Creates a new cell. | |
cmf::water::NeumannBoundary::ptr | NewNeumannBoundary (std::string name, cmf::water::WaterStorage::ptr target) |
Creates a new Neumann boundary for a target water storage. | |
cmf::river::OpenWaterStorage::ptr | NewOpenStorage (std::string name, double x, double y, double z, double area) |
Creates a new open water storage with a prism geometry. | |
cmf::water::DirichletBoundary::ptr | NewOutlet (std::string name, double x=0, double y=0, double z=0) |
Creates a new Dirichlet boundary condition and adds it to the list of outlets The potential of the Dirichlet boundary equals z, but can be changed. | |
cmf::river::Reach::ptr | NewReach (double x, double y, double z, cmf::river::IChannel &shape, bool diffusive=false) |
Creates a new reach. | |
cmf::water::WaterStorage::ptr | NewStorage (std::string name, double x=0, double y=0, double z=0) |
Creates a new generic water storage at position x,y,z. | |
size_t | node_count () const |
Returns the number of nodes saved with this project. | |
size_t | reach_count () const |
Returns the number of reaches in this project. | |
size_t | remove_node (cmf::water::flux_node::ptr node) |
Removes a node from the repository. | |
size_t | size () const |
The number of cells in the project. | |
void | use_IDW_meteo (double z_weight=0, double power=2) |
Uses IDW interpolation to generate meterological data for each cell of project. | |
void | use_IDW_rainfall (double z_weight=0, double power=2) |
Uses IDW interpolation to generate rainfall data for each cell of project. | |
void | use_nearest_meteo (double z_weight=0) |
Connects all cells of the project with its nearest meteorological station. | |
void | use_nearest_rainfall (double z_weight=0) |
Connects all cells of the project with its nearest rainfall station. | |
Public Attributes | |
cmf::atmosphere::MeteoStationList | meteo_stations |
The meteorological stations in the project. | |
cmf::atmosphere::RainfallStationList | rainfall_stations |
The rainfall stations of the project. | |
const cmf::water::solute_vector | solutes |
The solutes transported by the model. | |
Friends | |
class | cmf::upslope::Cell |
project | ( | std::string | solute_names = "" | ) |
Creates a new project.
solute_names | A string representing the names of the solutes to be used in the project. Sepereate solute names with space. |
cmf::upslope::Cell * NewCell | ( | double | x, |
double | y, | ||
double | z, | ||
double | area, | ||
bool | with_surfacewater = false ) |
Creates a new cell.
x,y,z | Position of the cell center in project coordinates (m) |
area | Area of the cell in m^2 |
with_surfacewater | If true, the cell will own a surfacewater storage upon creation |
cmf::water::NeumannBoundary::ptr NewNeumannBoundary | ( | std::string | name, |
cmf::water::WaterStorage::ptr | target ) |
Creates a new Neumann boundary for a target water storage.
The boundary is stored with the project
name | The name of the boundary condition |
target | The water storage to which the Neumann boundary is bound |
cmf::river::OpenWaterStorage::ptr NewOpenStorage | ( | std::string | name, |
double | x, | ||
double | y, | ||
double | z, | ||
double | area ) |
Creates a new open water storage with a prism geometry.
The open water storage is added to the project nodes
name | Name of the open water storage for output |
x,y,z | Position of the open water storage in project coordinates |
area | Surface area of the open water storage |
cmf::water::DirichletBoundary::ptr NewOutlet | ( | std::string | name, |
double | x = 0, | ||
double | y = 0, | ||
double | z = 0 ) |
Creates a new Dirichlet boundary condition and adds it to the list of outlets The potential of the Dirichlet boundary equals z, but can be changed.
name | Name of the boundary condition for output |
x,y,z | Position of the boundary condition in project coordinates |
cmf::river::Reach::ptr NewReach | ( | double | x, |
double | y, | ||
double | z, | ||
cmf::river::IChannel & | shape, | ||
bool | diffusive = false ) |
Creates a new reach.
x,y,z | Position of the reach in project coordinates |
shape | Crossectional geometry of the river. Any class inheriting from cmf::water::IChannel |
diffusive | If true, this reach uses by default a diffusive wave connection |
cmf::water::WaterStorage::ptr NewStorage | ( | std::string | name, |
double | x = 0, | ||
double | y = 0, | ||
double | z = 0 ) |
Creates a new generic water storage at position x,y,z.
The storage is added to the project nodes
name | Name of the generic water storage for output |
x,y,z | Position of the generic water storage condition in project coordinates |
size_t remove_node | ( | cmf::water::flux_node::ptr | node | ) |
Removes a node from the repository.
Removes a node (boundary condition or water storage) from the node repository of the project. NOTE: If you have other references to this node, the node is not deleted. If you are creating a new solver, the node will not be part of the solver.
void use_IDW_meteo | ( | double | z_weight = 0, |
double | power = 2 ) |
Uses IDW interpolation to generate meterological data for each cell of project.
Creates a meteo-data source for each cell, using spatial interpolated data from all meteorological stations of the project using Inverse Distance Weighted (IDW) interpolation. The meteorolgical value f is calculated with IDW for position x,y,z and time t as follows:
\begin{eqnarray*} f(x,y,z,t) &=& \sum^N_{i=1}{f_i(t) w_i(x,y,z)} \\ w_i(x,y,z) &=& \frac{d_i(x,y,z)^{-p}}{\sum^N_{j=0}{d_j(x,y,z)^{-p}}} \\ d_i(x,y,z) &=& w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \end{eqnarray*}
z_weight | \(w_z\) the weight of height difference between cell and station |
power | the power of the distance weight |
void use_IDW_rainfall | ( | double | z_weight = 0, |
double | power = 2 ) |
Uses IDW interpolation to generate rainfall data for each cell of project.
Creates a rainfall-data source for each cell, using spatial interpolated data from all meteorological stations of the project using Inverse Distance Weighted (IDW) interpolation. The rainfall intensity P is calculated with IDW for position x,y,z and time t as follows:
\begin{eqnarray*} P(x,y,z,t) &=& \sum^N_{i=1}{P_i(t) w_i(x,y,z)} \\ w_i(x,y,z) &=& \frac{d_i(x,y,z)^{-p}}{\sum^N_{j=0}{d_j(x,y,z)^{-p}}} \\ d_i(x,y,z) &=& w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \end{eqnarray*}
z_weight | \(w_z\) the weight of height difference between cell and station |
power | the power of the distance weight |
void use_nearest_meteo | ( | double | z_weight = 0 | ) |
Connects all cells of the project with its nearest meteorological station.
Distance is calculated as follows:
\[d_i(x,y,z) = w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \]
z_weight | \(w_z\) the weight of height difference between cell and station |
void use_nearest_rainfall | ( | double | z_weight = 0 | ) |
Connects all cells of the project with its nearest rainfall station.
Distance is calculated as follows:
\[d_i(x,y,z) = w_z \left|z-z_i\right| + \sqrt{\left(x-x_i\right)^2 + \left(y-y_i\right)^2} \]
z_weight | \(w_z\) the weight of height difference between cell and station |