NGen
Loading...
Searching...
No Matches
ngen::DomainLayer Class Reference

#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)
 Construct a new Domain Layer object.
 
void update_models () 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_typefeatures
 
const geojson::GeoJSON catchment_data
 
long output_time_index
 

Private Attributes

std::shared_ptr< realization::Catchment_Formulationformulation
 

Member Typedef Documentation

◆ feature_type

Constructor & Destructor Documentation

◆ DomainLayer() [1/2]

ngen::DomainLayer::DomainLayer ( )
delete

◆ DomainLayer() [2/2]

ngen::DomainLayer::DomainLayer ( const LayerDescription & desc,
const Simulation_Time & s_t,
feature_type & features,
long idx,
std::shared_ptr< realization::Catchment_Formulation > formulation )
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.

Parameters
descLayerDescription for the domain layer
s_tSimulation_Time object associated with the domain layer
featurescollection of HY_Features associated with the domain
idxindex of the layer
formulationFormulation associated with the domain

References formulation, realization::Catchment_Formulation::get_output_header_line(), and HY_CatchmentArea::write_output().

Member Function Documentation

◆ current_timestep_epoch_time()

time_t ngen::Layer::current_timestep_epoch_time ( )
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.

◆ get_id()

int ngen::Layer::get_id ( ) const
inlineinherited

Return the numeric id of this layer.

References ngen::Layer::description, and ngen::LayerDescription::id.

◆ get_name()

const std::string & ngen::Layer::get_name ( ) const
inlineinherited

Return the name of this layer.

References ngen::Layer::description, and ngen::LayerDescription::name.

◆ get_time_step()

const double ngen::Layer::get_time_step ( ) const
inlineinherited

Return this time_step interval used for this layer.

References ngen::Layer::description, and ngen::LayerDescription::time_step.

◆ get_time_step_units()

const std::string & ngen::Layer::get_time_step_units ( ) const
inlineinherited

Return the units for the time_step value of this layer.

References ngen::Layer::description, and ngen::LayerDescription::time_step_units.

◆ next_timestep_epoch_time()

time_t ngen::Layer::next_timestep_epoch_time ( )
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.

◆ update_models()

void ngen::DomainLayer::update_models ( )
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::description, formulation, Simulation_Time::get_output_interval_seconds(), realization::Catchment_Formulation::get_output_line_for_timestep(), realization::Catchment_Formulation::get_response(), Simulation_Time::get_timestamp(), Simulation_Time::get_total_output_times(), ngen::LayerDescription::id, ngen::LayerDescription::name, ngen::Layer::output_time_index, ngen::Layer::simulation_time, models::external::State_Exception::what(), and HY_CatchmentArea::write_output().

Member Data Documentation

◆ catchment_data

const geojson::GeoJSON ngen::Layer::catchment_data
protectedinherited

◆ description

◆ features

feature_type& ngen::Layer::features
protectedinherited

◆ formulation

std::shared_ptr<realization::Catchment_Formulation> ngen::DomainLayer::formulation
private

Referenced by DomainLayer(), and update_models().

◆ output_time_index

long ngen::Layer::output_time_index
protectedinherited

◆ processing_units

const std::vector<std::string> ngen::Layer::processing_units
protectedinherited

◆ simulation_time


The documentation for this class was generated from the following file: