|
NGen
|
#include <DomainLayer.hpp>
Inheritance diagram for ngen::DomainLayer:
Collaboration diagram for ngen::DomainLayer:Public Types | |
| using | feature_type = hy_features::HY_Features |
Public Member Functions | |
| DomainLayer ()=delete | |
| DomainLayer (const LayerDescription &desc, const Simulation_Time &s_t, feature_type &features, long idx, std::shared_ptr< realization::Catchment_Formulation > formulation, std::shared_ptr< utils::CatchmentOutputsMgr > output_mgr) | |
| Construct a new Domain Layer object. | |
| void | update_models (boost::span< double > catchment_outflows, std::unordered_map< std::string, int > const &catchment_indexes, boost::span< double > nexus_downstream_flows, std::unordered_map< std::string, int > const &nexus_indexes, int current_step) override |
| Run one simulation timestep for this model associated with the domain. | |
| time_t | next_timestep_epoch_time () |
| Return the next timestep that will be processed by this layer in epoch time units. | |
| time_t | current_timestep_epoch_time () |
| Return the last timestep that was processed by this layer in epoch time units. | |
| int | get_id () const |
| Return the numeric id of this layer. | |
| const std::string & | get_name () const |
| Return the name of this layer. | |
| const double | get_time_step () const |
| Return this time_step interval used for this layer. | |
| const std::string & | get_time_step_units () const |
| Return the units for the time_step value of this layer. | |
Protected Attributes | |
| const LayerDescription | description |
| const std::vector< std::string > | processing_units |
| Simulation_Time | simulation_time |
| feature_type & | features |
| const geojson::GeoJSON | catchment_data |
| long | output_time_index |
| std::shared_ptr< utils::CatchmentOutputsMgr > | catchment_output_mgr = nullptr |
| Catchment output sink for this layer's per-timestep push; null when output is disabled. | |
Private Attributes | |
| std::shared_ptr< realization::Catchment_Formulation > | formulation |
| std::string | output_formulation_id |
| This layer's identity in the shared manager, split into its (formulation, catchment) key. | |
| std::string | output_catchment_id |
|
inherited |
|
delete |
|
inline |
Construct a new Domain Layer object.
Unlike HY_Features types, the feature relationship with a DomainLayer is indirect. The features collection defines features associated (e.g. overlapping) with the Domain. The domain must be further queried in order to provide specific information at a particular feature, e.g. a catchment which this domain overlaps with, or a nexus location the domain may contribute to directly/indirectly via the catchment.
A domain layer associated with a set of catchment features will need to have outputs of the domain resampled/aggregated to the catchment.
Currently unsupported, but a future extension of the DomainLayer is interactions beetween two or more generic DomainLayers, perhaps each with its own internal grid, and resampling between the layers would be required similarly to resampling from a DomainLayer to the HY_Features catchment domain.
| desc | LayerDescription for the domain layer |
| s_t | Simulation_Time object associated with the domain layer |
| features | collection of HY_Features associated with the domain |
| idx | index of the layer |
| formulation | Formulation associated with the domain |
| output_mgr | Shared, driver-owned catchment output manager (may be null when output is disabled). The layer registers as its own feature (formulation id "layer_<id>", feature id = the layer name) in that manager, so its output honors the configured format/grouping and lands in its own file alongside the surface catchments. |
|
inlineinherited |
Return the last timestep that was processed by this layer in epoch time units.
References Simulation_Time::get_current_epoch_time(), and ngen::Layer::simulation_time.
|
inlineinherited |
Return the numeric id of this layer.
References ngen::Layer::description, and ngen::LayerDescription::id.
|
inlineinherited |
Return the name of this layer.
References ngen::Layer::description, and ngen::LayerDescription::name.
|
inlineinherited |
Return this time_step interval used for this layer.
References ngen::Layer::description, and ngen::LayerDescription::time_step.
|
inlineinherited |
Return the units for the time_step value of this layer.
References ngen::Layer::description, and ngen::LayerDescription::time_step_units.
|
inlineinherited |
Return the next timestep that will be processed by this layer in epoch time units.
References Simulation_Time::next_timestep_epoch_time(), and ngen::Layer::simulation_time.
|
inlineoverridevirtual |
Run one simulation timestep for this model associated with the domain.
A domain layer update simply advances the attached domain formulation(s) in time and records the BMI accessible outputs of the domain formulation. Since this is NOT a HY_Features concept/class, it doesn't directly associate with HY_Features types (e.g. catchments, nexus, ect)
Any required connection to other components, e.g. providing inputs to a catchment feature, is not yet implemented in this class.
Reimplemented from ngen::Layer.
References Simulation_Time::advance_timestep(), ngen::Layer::catchment_output_mgr, ngen::Layer::description, formulation, Simulation_Time::get_current_epoch_time(), Simulation_Time::get_output_interval_seconds(), realization::Catchment_Formulation::get_output_values_for_timestep(), realization::Catchment_Formulation::get_response(), Simulation_Time::get_timestamp(), Simulation_Time::get_total_output_times(), ngen::LayerDescription::id, ngen::LayerDescription::name, output_catchment_id, output_formulation_id, ngen::Layer::output_time_index, utils::CatchmentOutputsMgr::receive_data_entry(), ngen::Layer::simulation_time, and models::external::State_Exception::what().
|
protectedinherited |
Referenced by ngen::Layer::update_models().
|
protectedinherited |
Catchment output sink for this layer's per-timestep push; null when output is disabled.
Referenced by update_models(), and ngen::Layer::update_models().
|
protectedinherited |
|
protectedinherited |
Referenced by ngen::Layer::update_models(), and ngen::SurfaceLayer::update_models().
|
private |
Referenced by update_models().
|
private |
Referenced by update_models().
|
private |
This layer's identity in the shared manager, split into its (formulation, catchment) key.
Referenced by update_models().
|
protectedinherited |
Referenced by update_models(), ngen::Layer::update_models(), and ngen::SurfaceLayer::update_models().
|
protectedinherited |
Referenced by ngen::Layer::update_models().
|
protectedinherited |