NGen
Loading...
Searching...
No Matches
NullForcingProvider Class Referenceabstract

Forcing class that returns no variables to the simulation–use this e.g. More...

#include <NullForcingProvider.hpp>

+ Inheritance diagram for NullForcingProvider:
+ Collaboration diagram for NullForcingProvider:

Public Types

using data_type = DataType
 This class provides a generic interface to data services.
 
using selection_type = SelectionType
 

Public Member Functions

 NullForcingProvider ()
 
long get_data_start_time () const override
 Return the first valid time for which data from the request variable can be requested.
 
long get_data_stop_time () const override
 Return the last valid time for which data from the requested variable can be requested.
 
long record_duration () const override
 Return the stride in the time dimension.
 
size_t get_ts_index_for_time (const time_t &epoch_time) const override
 Get the index of the data time step that contains the given point in time.
 
double get_value (const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
 
std::vector< double > get_values (const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
 
bool is_property_sum_over_time_step (const std::string &name) const override
 
boost::span< const std::string > get_available_variable_names () const override
 Return the variables that are accessable by this data provider.
 
virtual void finalize ()
 Release any resources that should not be held as the run is shutting down.
 
virtual data_type get_value (const selection_type &selector, ReSampleMethod m=SUM)=0
 Get the value of a forcing property for an arbitrary time period, converting units if needed.
 
virtual std::vector< data_typeget_values (const selection_type &selector, ReSampleMethod m=SUM)=0
 Get the values of a forcing property for an arbitrary time period, converting units if needed.
 

Detailed Description

Forcing class that returns no variables to the simulation–use this e.g.

if a BMI model provides forcing data.

Member Typedef Documentation

◆ data_type

template<class DataType , class SelectionType >
using data_access::DataProvider< DataType, SelectionType >::data_type = DataType
inherited

This class provides a generic interface to data services.

◆ selection_type

template<class DataType , class SelectionType >
using data_access::DataProvider< DataType, SelectionType >::selection_type = SelectionType
inherited

Constructor & Destructor Documentation

◆ NullForcingProvider()

NullForcingProvider::NullForcingProvider ( )
default

Member Function Documentation

◆ finalize()

template<class DataType , class SelectionType >
virtual void data_access::DataProvider< DataType, SelectionType >::finalize ( )
inlinevirtualinherited

Release any resources that should not be held as the run is shutting down.

In particular, this should be called before MPI_Finalize()

Reimplemented in data_access::WrappedDataProvider.

◆ get_available_variable_names()

boost::span< const std::string > NullForcingProvider::get_available_variable_names ( ) const
overridevirtual

Return the variables that are accessable by this data provider.

Implements data_access::DataProvider< DataType, SelectionType >.

◆ get_data_start_time()

long NullForcingProvider::get_data_start_time ( ) const
overridevirtual

Return the first valid time for which data from the request variable can be requested.

Implements data_access::DataProvider< DataType, SelectionType >.

◆ get_data_stop_time()

long NullForcingProvider::get_data_stop_time ( ) const
overridevirtual

Return the last valid time for which data from the requested variable can be requested.

Implements data_access::DataProvider< DataType, SelectionType >.

◆ get_ts_index_for_time()

size_t NullForcingProvider::get_ts_index_for_time ( const time_t & epoch_time) const
overridevirtual

Get the index of the data time step that contains the given point in time.

An std::out_of_range exception should be thrown if the time is not in any time step.

Parameters
epoch_timeThe point in time, as a seconds-based epoch time.
Returns
The index of the forcing time step that contains the given point in time.
Exceptions
std::out_of_rangeIf the given point is not in any time step.

Implements data_access::DataProvider< DataType, SelectionType >.

◆ get_value() [1/2]

template<class DataType , class SelectionType >
virtual data_type data_access::DataProvider< DataType, SelectionType >::get_value ( const selection_type & selector,
ReSampleMethod m = SUM )
pure virtualinherited

Get the value of a forcing property for an arbitrary time period, converting units if needed.

An std::out_of_range exception should be thrown if the data for the time period is not available.

Parameters
selectorData required to establish what subset of the stored data should be accessed
mHow data is to be resampled if there is a mismatch in data alignment or repeat rate
Returns
The value of the forcing property for the described time period, with units converted if needed.
Exceptions
std::out_of_rangeIf data for the time period is not available.

Referenced by data_access::WrappedDataProvider::get_value(), and realization::Bmi_Module_Formulation::set_model_inputs_prior_to_update().

◆ get_value() [2/2]

double NullForcingProvider::get_value ( const CatchmentAggrDataSelector & selector,
data_access::ReSampleMethod m )
override

◆ get_values() [1/2]

template<class DataType , class SelectionType >
virtual std::vector< data_type > data_access::DataProvider< DataType, SelectionType >::get_values ( const selection_type & selector,
ReSampleMethod m = SUM )
pure virtualinherited

Get the values of a forcing property for an arbitrary time period, converting units if needed.

An std::out_of_range exception should be thrown if the data for the time period is not available.

If a provider doesn't implement this function, then by default, get_values will be a simple proxy to get_value with the result wrapped in a std::vector<double>

Parameters
output_nameThe name of the forcing property of interest.
init_time_epochThe epoch time (in seconds) of the start of the time period.
duration_secondsThe length of the time period, in seconds.
output_unitsThe expected units of the desired output value.
Returns
std::vector<double> The vector of values of the forcing property for the described time period, with units converted if needed.
Exceptions
std::out_of_rangeIf data for the time period is not available.

Referenced by data_access::WrappedDataProvider::get_values(), and realization::Bmi_Module_Formulation::set_model_inputs_prior_to_update().

◆ get_values() [2/2]

std::vector< double > NullForcingProvider::get_values ( const CatchmentAggrDataSelector & selector,
data_access::ReSampleMethod m )
override

◆ is_property_sum_over_time_step()

bool NullForcingProvider::is_property_sum_over_time_step ( const std::string & name) const
inlineoverridevirtual

◆ record_duration()

long NullForcingProvider::record_duration ( ) const
overridevirtual

Return the stride in the time dimension.

Implements data_access::DataProvider< DataType, SelectionType >.


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