|
| | HY_CatchmentRealization () |
| |
| | HY_CatchmentRealization (std::string catchment_id, std::shared_ptr< realization::Formulation > formulation) |
| |
| virtual | ~HY_CatchmentRealization () |
| |
| const std::shared_ptr< realization::Formulation > & | get_formulation () const |
| | The model producing this feature's values, or nullptr where the feature is not modeled.
|
| |
| const std::string & | get_catchment_id () const |
| | The id this feature shares with the catchment it realizes.
|
| |
| std::shared_ptr< HY_Catchment > | realize (std::vector< std::string > inflows, std::vector< std::string > outflows, long layer=0) |
| | Build the catchment this feature is a perspective of, and bind the two together.
|
| |
| std::shared_ptr< HY_Catchment > | get_realized_catchment () const |
| | The catchment this feature realizes, whose inflow and outflow nexuses it shares.
|
| |
| virtual std::optional< double > | area_sqkm () const |
| | The areal extent of this feature, in square kilometers, where the perspective has one.
|
| |
| virtual Response | get_response (time_step_t t_index, time_step_t t_delta) |
| | Execute the attached model for the given time step, where it is of the specified size, and return the perspective's response.
|
| |
A hydrology-specific perspective of a catchment.
A catchment is realized as the face it covers (HY_CatchmentArea), as the edge bounding that face (HY_CatchmentDivide), or as the edge running through it (HY_FlowPath). Each subtype carries the topology of its own perspective, and so answers what a value associated with the feature is distributed over.
A realization is constructed with the identity of the catchment it realizes. realize then builds that catchment and binds the two, after which the realization can reach the nexuses flowing into and out of it.
A realization may have a formulation attached, which is what produces the values associated with the feature. A catchment can be realized several ways and not every realization is modeled, so the attachment is optional.
| virtual std::optional< double > HY_CatchmentRealization::area_sqkm |
( |
| ) |
const |
|
inlinevirtual |
The areal extent of this feature, in square kilometers, where the perspective has one.
A face has an area, and so does the edge bounding that face; the edge running through it has a length instead. Empty therefore says the perspective has no extent to give, never that the hydrofabric withheld one: a catchment whose hydrofabric carries no extent is refused when the realization is built, so it does not reach here.
Reimplemented in HY_CatchmentArea.
Execute the attached model for the given time step, where it is of the specified size, and return the perspective's response.
A model's value is assumed to be depth by default.
- Parameters
-
| t_index | The index of the time step for which to run model calculations. |
| t_delta | The duration, in seconds, of the time step for which to run model calculations. |
- Returns
- This perspective's response for the step, as each Quantity it expresses.
- Exceptions
-
| std::runtime_error | If this feature has no formulation attached. |
Reimplemented in HY_CatchmentArea.
References formulation, get_catchment_id(), and realization::Formulation::get_response().
Referenced by HY_CatchmentArea::get_response().
| std::shared_ptr< HY_Catchment > HY_CatchmentRealization::realize |
( |
std::vector< std::string > | inflows, |
|
|
std::vector< std::string > | outflows, |
|
|
long | layer = 0 ) |
Build the catchment this feature is a perspective of, and bind the two together.
The catchment is given this realization's identity, so the pair cannot disagree about what it names. Each then holds the other: the catchment owns its realization, and the realization reaches back to the catchment for its nexuses.
One realization is one perspective of one catchment. Calling this again returns the catchment already built and does not apply the arguments; realizing a catchment from another perspective means another realization, which builds its own.
- Parameters
-
| inflows | Ids of the nexuses contributing to the catchment. |
| outflows | Ids of the nexuses the catchment contributes to. |
| layer | The hydrofabric layer the catchment belongs to. |
- Returns
- The catchment, newly built or the one this realization already built.
- Exceptions
-
| std::bad_weak_ptr | If this realization is not already held by a shared_ptr. |
References catchment_id, and realized_catchment.
Referenced by HY_CatchmentRealization_Test::SetUp().