NGen
Loading...
Searching...
No Matches
realization::Bmi_Formulation Class Referenceabstract

Abstraction of formulation with backing model object(s) that implements the BMI. More...

#include <Bmi_Formulation.hpp>

+ Inheritance diagram for realization::Bmi_Formulation:
+ Collaboration diagram for realization::Bmi_Formulation:

Public Types

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

Public Member Functions

 Bmi_Formulation (std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing)
 Minimal constructor for objects initialized using the Formulation_Manager and subsequent calls to create_formulation.
 
virtual ~Bmi_Formulation ()
 
virtual time_t convert_model_time (const double &model_time) const =0
 Convert a time value from the model to an epoch time in seconds.
 
virtual const bool & get_allow_model_exceed_end_time () const =0
 Get whether a model may perform updates beyond its end_time.
 
virtual const std::vector< std::string > get_bmi_input_variables () const =0
 
const std::string & get_bmi_main_output_var () const
 
virtual const time_t & get_bmi_model_start_time_forcing_offset_s () const =0
 
virtual const std::vector< std::string > get_bmi_output_variables () const =0
 
virtual const std::string & get_config_mapped_variable_name (const std::string &model_var_name) const =0
 When possible, translate a variable name for a BMI model to an internally recognized name.
 
virtual const double get_model_current_time () const =0
 Get the current time for the backing BMI model in its native format and units.
 
virtual const double get_model_end_time () const =0
 Get the end time for the backing BMI model in its native format and units.
 
std::string get_model_type_name () const
 Get the name of the specific type of the backing model object.
 
std::string compound_id () const
 Get this formulation instance's compound identity.
 
const std::vector< std::string > & get_output_variable_names () const
 Get the names of variables in formulation output.
 
const std::vector< std::string > & get_required_parameters () const override
 
virtual bool is_bmi_input_variable (const std::string &var_name) const =0
 
virtual bool is_bmi_model_time_step_fixed () const =0
 Test whether backing model has fixed time step size.
 
virtual bool is_bmi_output_variable (const std::string &var_name) const =0
 
virtual bool is_model_initialized () const =0
 Test whether the backing model has been initialize using the BMI standard Initialize function.
 
void update (time_step_t t_index, time_step_t t_delta) override=0
 Advance the backing model formulation through the given time step.
 
virtual std::string get_formulation_type () const =0
 
virtual void finalize ()
 Release any resources that should not be held as the run is shutting down.
 
virtual std::span< const std::string > get_available_variable_names () const =0
 Return the variables that are accessable by this data provider.
 
virtual long get_data_start_time () const =0
 Return the first valid time for which data from the request variable can be requested.
 
virtual long get_data_stop_time () const =0
 Return the last valid time for which data from the requested variable can be requested.
 
virtual long record_duration () const =0
 Return the stride in the time dimension.
 
virtual size_t get_ts_index_for_time (const time_t &epoch_time) const =0
 Get the index of the data time step that contains the given point in time.
 
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_type > get_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.
 
virtual bool is_property_sum_over_time_step (const std::string &name) const
 
Identity

Three roles, not three independent names.

A formulation has a subject, a locator, and an identity made of the two:

  • subject – get_feature_id, the feature whose data this model reads and produces. Not unique: every model attached to one catchment shares it. Use it to reach forcing and feature data, to name a catchment in a message, and to substitute {{id}} in a config path.
  • locator – get_id, where this sits in that feature's tree of models. The root of that tree is the feature itself, which is why the two hold the same string for a formulation built directly against one. Unique, and what Formulation_Manager keys on.
  • identity – Bmi_Formulation::compound_id(), the locator together with what runs there. Unique, and what serialization records are keyed by, so a restore can tell it is loading into the same model the record came from.

model_type_name is not a fourth identity; it is the component compound_id adds to the locator.

catchment formulation domain layer module 0 of a multi on cat-27
subject cat-27 layer-1 cat-27
locator cat-27 layer-1 cat-27.0
identity cat-27:bmi_c_cfe layer-1:bmi_c_cfe cat-27.0:bmi_c_cfe:bmi_multi_x

Subject and locator diverge only when one formulation composes another. The composer builds each module's locator from its own locator and that module's index within it, so a multi on cat-27 gives its first module cat-27.0; and it hands that module its own subject untouched, so the module still reads cat-27's forcing. Compose once more and the locator grows to cat-27.0.1 while the subject is still cat-27.

A domain layer has no hydrofabric feature, but the layer is still what its model belongs to, so it stands as the subject.

std::string get_id () const
 See Identity.
 
virtual void create_formulation (boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr)=0
 See Identity.
 
virtual void create_formulation (geojson::PropertyMap properties)=0
 See Identity.
 
virtual void check_mass_balance (const int &iteration, const int &total_steps, const std::string &timestamp) const =0
 See Identity.
 
virtual void checkpoint_state (const int &iteration, const int &total_steps, const std::string &timestamp) const =0
 Invoke the state-save side of the ngen BMI Serialization Protocol.
 
virtual double get_response (time_step_t t_index, time_step_t t_delta)=0
 Execute the backing model formulation for the given time step, where it is of the specified size, and return the response output.
 
virtual std::vector< utils::OutputField > get_output_fields () const =0
 Get this formulation's output fields – name plus metadata (units, ...) – in the same order as the values returned by get_output_values_for_timestep.
 
virtual std::vector< double > get_output_values_for_timestep (int timestep)=0
 Get the output values for the given time step, positionally aligned with get_output_fields.
 
void finalize ()
 Release resources of the given forcing provider.
 
const std::string & get_feature_id () const
 The feature whose data this model reads and produces; see Identity.
 
void set_feature_id (const std::string &feature_id)
 Associate this formulation with a feature other than the one it is named for.
 

Protected Member Functions

void set_bmi_main_output_var (const std::string &main_output_var)
 
virtual void set_model_type_name (std::string type_name)
 Set the name of the specific type of the backing model object.
 
void set_compound_id (std::string id_string)
 Override this formulation's compound identity.
 
void set_output_header_fields (const std::vector< std::string > &output_headers)
 
std::span< const std::string > get_output_header_field_names () const
 The configured/derived output header (display) field names, positionally parallel to get_output_variable_names – header i is the output name for variable i.
 
void set_output_variable_names (const std::vector< std::string > &out_var_names)
 Set the names of variables in formulation output.
 
geojson::PropertyMap interpret_parameters (boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr)
 
void validate_parameters (geojson::PropertyMap options)
 

Protected Attributes

std::string id
 This formulation's locator; see get_id.
 
std::shared_ptr< data_access::GenericDataProvider > forcing
 

Private Attributes

std::string bmi_main_output_var
 
std::string model_type_name
 
std::string compound_id_
 Explicit compound identity override.
 
std::vector< std::string > output_header_fields
 Output header field strings corresponding to the variables output by the realization, as defined in output_variable_names.
 
std::vector< std::string > output_variable_names
 Names of the variables to include in the output from this formulation, which will be some ordered subset of the BMI module output variables accessible to the instance.
 
std::string feature_id
 This formulation's subject; see get_feature_id.
 

Static Private Attributes

static const std::vector< std::string > OPTIONAL_PARAMETERS
 
static const std::vector< std::string > REQUIRED_PARAMETERS
 

Friends

class ::Bmi_Formulation_Test
 
class ::Bmi_C_Formulation_Test
 

Detailed Description

Abstraction of formulation with backing model object(s) that implements the BMI.

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

◆ time_step_t

Constructor & Destructor Documentation

◆ Bmi_Formulation()

realization::Bmi_Formulation::Bmi_Formulation ( std::string id,
std::shared_ptr< data_access::GenericDataProvider > forcing )
inline

Minimal constructor for objects initialized using the Formulation_Manager and subsequent calls to create_formulation.

Parameters
id
forcing

◆ ~Bmi_Formulation()

virtual realization::Bmi_Formulation::~Bmi_Formulation ( )
inlinevirtual

Member Function Documentation

◆ check_mass_balance()

virtual void realization::Formulation::check_mass_balance ( const int & iteration,
const int & total_steps,
const std::string & timestamp ) const
pure virtualinherited

◆ checkpoint_state()

virtual void realization::Formulation::checkpoint_state ( const int & iteration,
const int & total_steps,
const std::string & timestamp ) const
pure virtualinherited

Invoke the state-save side of the ngen BMI Serialization Protocol.

Called from the per-timestep driver (see core/Layer.cpp) alongside check_mass_balance. Implementations build a protocol Context from the arguments and the formulation's own compound identity, then forward to the NgenBmiProtocols container. Non-BMI formulations may implement as a no-op; unconfigured save protocols short-circuit inside run() so the cost is just the virtual dispatch.

Implemented in Depth_Formulation, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ compound_id()

std::string realization::Bmi_Formulation::compound_id ( ) const
inline

Get this formulation instance's compound identity.

Default composition for a single-BMI formulation: "<this->id>:<model_type_name>" e.g. "cat-1:bmi_c_cfe"

For a Bmi_Multi_Formulation submodule, Bmi_Multi_Formulation injects a three-part compound via set_compound_id() before create_formulation() runs: "<this->id>:<submodule-mtn>:<multi-mtn>" e.g. "cat-1.0:bmi_c_cfe:bmi_multi_noahowp_cfe"

Uniqueness

The composition is unique in practice: single-BMI keys are unique because id is a catchment identifier and one catchment has at most one realization; multi-submodule keys are unique because the submodule index suffix in this->id (e.g. the .0 in cat-1.0) already disambiguates siblings even when two submodules share a model_type_name.

One scenario that could break that assumption in the future: if the engine ever instantiates two different multi formulations for the same id (e.g. A/B comparison runs on the same catchment within a single process), the outer <multi-mtn> suffix becomes the sole discriminator and must actually differ. Callers would need to set distinct model_type_name values on the two multi formulations, or pass a unique string via set_compound_id().

Returns
The compound identity string, or the default composition when set_compound_id was never called.

References compound_id_, and model_type_name.

Referenced by realization::Bmi_Module_Formulation::checkpoint_state(), and realization::Bmi_Module_Formulation::inner_create_formulation().

◆ convert_model_time()

virtual time_t realization::Bmi_Formulation::convert_model_time ( const double & model_time) const
pure virtual

Convert a time value from the model to an epoch time in seconds.

Model time values are typically (though not always) 0-based totals count upward as time progresses. The units are not necessarily seconds. This performs the necessary lookup and conversion for such units, and then shifts the value appropriately for epoch time representation.

Parameters
model_time
Returns

Implemented in realization::Bmi_C_Formulation, realization::Bmi_Cpp_Formulation, and realization::Bmi_Multi_Formulation.

Referenced by realization::Bmi_Module_Formulation::determine_model_time_offset(), realization::Bmi_Module_Formulation::inner_create_formulation(), and realization::Bmi_Module_Formulation::set_model_inputs_prior_to_update().

◆ create_formulation() [1/2]

virtual void realization::Formulation::create_formulation ( boost::property_tree::ptree & config,
geojson::PropertyMap * global = nullptr )
pure virtualinherited

◆ create_formulation() [2/2]

virtual void realization::Formulation::create_formulation ( geojson::PropertyMap properties)
pure virtualinherited

◆ finalize() [1/2]

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.

◆ finalize() [2/2]

void realization::Formulation::finalize ( )
inherited

Release resources of the given forcing provider.

References realization::Formulation::forcing.

◆ get_allow_model_exceed_end_time()

virtual const bool & realization::Bmi_Formulation::get_allow_model_exceed_end_time ( ) const
pure virtual

Get whether a model may perform updates beyond its end_time.

Get whether model Update calls are allowed and handled in some way by the backing model for time steps after the model's end_time. Implementations of this type should use this function to safeguard against entering either an invalid or otherwise undesired state as a result of attempting to process a model beyond its available data.

As mentioned, even for models that are capable of validly handling processing beyond end time, it may be desired that they do not for some reason (e.g., the way they account for the lack of input data leads to valid but incorrect results for a specific application). Because of this, whether models are allowed to process beyond their end time is configuration-based.

Returns
Whether a model may perform updates beyond its end_time.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ get_available_variable_names()

template<class DataType , class SelectionType >
virtual std::span< const std::string > data_access::DataProvider< DataType, SelectionType >::get_available_variable_names ( ) const
pure virtualinherited

◆ get_bmi_input_variables()

virtual const std::vector< std::string > realization::Bmi_Formulation::get_bmi_input_variables ( ) const
pure virtual

◆ get_bmi_main_output_var()

const std::string & realization::Bmi_Formulation::get_bmi_main_output_var ( ) const
inline

◆ get_bmi_model_start_time_forcing_offset_s()

virtual const time_t & realization::Bmi_Formulation::get_bmi_model_start_time_forcing_offset_s ( ) const
pure virtual

◆ get_bmi_output_variables()

virtual const std::vector< std::string > realization::Bmi_Formulation::get_bmi_output_variables ( ) const
pure virtual

◆ get_config_mapped_variable_name()

virtual const std::string & realization::Bmi_Formulation::get_config_mapped_variable_name ( const std::string & model_var_name) const
pure virtual

When possible, translate a variable name for a BMI model to an internally recognized name.

Parameters
model_var_nameThe BMI variable name to translate so its purpose is recognized internally.
Returns
Either the translated equivalent variable name, or the provided name if there is not a mapping entry.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ get_data_start_time()

template<class DataType , class SelectionType >
virtual long data_access::DataProvider< DataType, SelectionType >::get_data_start_time ( ) const
pure virtualinherited

◆ get_data_stop_time()

template<class DataType , class SelectionType >
virtual long data_access::DataProvider< DataType, SelectionType >::get_data_stop_time ( ) const
pure virtualinherited

◆ get_feature_id()

◆ get_formulation_type()

◆ get_id()

std::string realization::Formulation::get_id ( ) const
inlineinherited

◆ get_model_current_time()

virtual const double realization::Bmi_Formulation::get_model_current_time ( ) const
pure virtual

Get the current time for the backing BMI model in its native format and units.

Returns
The current time for the backing BMI model in its native format and units.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ get_model_end_time()

virtual const double realization::Bmi_Formulation::get_model_end_time ( ) const
pure virtual

Get the end time for the backing BMI model in its native format and units.

Returns
The end time for the backing BMI model in its native format and units.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ get_model_type_name()

std::string realization::Bmi_Formulation::get_model_type_name ( ) const
inline

Get the name of the specific type of the backing model object.

Returns
The name of the backing model object's type.

References model_type_name.

Referenced by realization::Bmi_C_Formulation::construct_model(), realization::Bmi_Cpp_Formulation::construct_model(), and realization::Bmi_Multi_Formulation::init_nested_module().

◆ get_output_fields()

virtual std::vector< utils::OutputField > realization::Formulation::get_output_fields ( ) const
pure virtualinherited

Get this formulation's output fields – name plus metadata (units, ...) – in the same order as the values returned by get_output_values_for_timestep.

The name is the output header field (configured, or defaulting to the output variable name); the units come from the same source that produces each value. So each field is positionally aligned with, and describes, the corresponding value.

Returns
The ordered output fields.

Implemented in Depth_Formulation, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ get_output_header_field_names()

std::span< const std::string > realization::Bmi_Formulation::get_output_header_field_names ( ) const
inlineprotected

The configured/derived output header (display) field names, positionally parallel to get_output_variable_names – header i is the output name for variable i.

A concrete subclass uses these as each column's output_name when building get_output_fields.

References output_header_fields.

Referenced by realization::Bmi_Module_Formulation::get_output_fields(), and realization::Bmi_Multi_Formulation::get_output_fields().

◆ get_output_values_for_timestep()

virtual std::vector< double > realization::Formulation::get_output_values_for_timestep ( int timestep)
pure virtualinherited

Get the output values for the given time step, positionally aligned with get_output_fields.

Values are returned as raw doubles, with no formatting or precision applied by the formulation.

Parameters
timestepThe time step for which values are desired.
Returns
The output values for timestep, one per output column.

Implemented in Depth_Formulation, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

Referenced by ngen::DomainLayer::update_models().

◆ get_output_variable_names()

const std::vector< std::string > & realization::Bmi_Formulation::get_output_variable_names ( ) const
inline

◆ get_required_parameters()

const std::vector< std::string > & realization::Bmi_Formulation::get_required_parameters ( ) const
inlineoverridevirtual

◆ get_response()

virtual double realization::Formulation::get_response ( time_step_t t_index,
time_step_t t_delta )
pure virtualinherited

Execute the backing model formulation for the given time step, where it is of the specified size, and return the response output.

Advances the model as update does, and additionally reduces its state to one value. Callers that only need the model stepped should use update instead. This function should be implemented and used when a single-value representation of the model's state is required.

Any inputs and additional parameters must be made available as instance members.

The response is a depth, in meters. Implementations are responsible for converting it: the BMI ones ask their model for "m" and convert from whatever it declares in GetVarUnits. HY_CatchmentRealization takes that for granted when it records the response as a depth, and HY_CatchmentArea multiplies it by an area in m^2.

Types should clearly document anything further about their particular response.

Parameters
t_indexThe index of the time step for which to run model calculations.
t_deltaThe duration, in seconds, of the time step for which to run model calculations.
Returns
The response output of the model for this time step, as a depth in meters.

Implemented in Depth_Formulation, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

Referenced by HY_CatchmentRealization::get_response().

◆ get_ts_index_for_time()

template<class DataType , class SelectionType >
virtual size_t data_access::DataProvider< DataType, SelectionType >::get_ts_index_for_time ( const time_t & epoch_time) const
pure virtualinherited

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.

Implemented in CsvPerFeatureForcingProvider, data_access::WrappedDataProvider, NullForcingProvider, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

Referenced by data_access::WrappedDataProvider::get_ts_index_for_time().

◆ get_value()

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().

◆ get_values()

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().

◆ interpret_parameters()

geojson::PropertyMap realization::Formulation::interpret_parameters ( boost::property_tree::ptree & config,
geojson::PropertyMap * global = nullptr )
protectedinherited

◆ is_bmi_input_variable()

virtual bool realization::Bmi_Formulation::is_bmi_input_variable ( const std::string & var_name) const
pure virtual

◆ is_bmi_model_time_step_fixed()

virtual bool realization::Bmi_Formulation::is_bmi_model_time_step_fixed ( ) const
pure virtual

Test whether backing model has fixed time step size.

Returns
Whether backing model has fixed time step size.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ is_bmi_output_variable()

virtual bool realization::Bmi_Formulation::is_bmi_output_variable ( const std::string & var_name) const
pure virtual

◆ is_model_initialized()

virtual bool realization::Bmi_Formulation::is_model_initialized ( ) const
pure virtual

Test whether the backing model has been initialize using the BMI standard Initialize function.

Returns
Whether backing model has been initialize using the BMI standard Initialize function.

Implemented in realization::Bmi_C_Formulation, realization::Bmi_Cpp_Formulation, realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ is_property_sum_over_time_step()

template<class DataType , class SelectionType >
virtual bool data_access::DataProvider< DataType, SelectionType >::is_property_sum_over_time_step ( const std::string & name) const
inlinevirtualinherited

◆ record_duration()

template<class DataType , class SelectionType >
virtual long data_access::DataProvider< DataType, SelectionType >::record_duration ( ) const
pure virtualinherited

◆ set_bmi_main_output_var()

void realization::Bmi_Formulation::set_bmi_main_output_var ( const std::string & main_output_var)
inlineprotected

◆ set_compound_id()

void realization::Bmi_Formulation::set_compound_id ( std::string id_string)
inlineprotected

Override this formulation's compound identity.

Callable (notably Bmi_Multi_Formulation during submodule setup) when the default compound_id() composition isn't appropriate — e.g., to prepend multi-formulation context An empty string restores the default.

References compound_id_.

◆ set_feature_id()

void realization::Formulation::set_feature_id ( const std::string & feature_id)
inlineinherited

Associate this formulation with a feature other than the one it is named for.

For a formulation composing others: a nested module's id names its position within the composition, so the composing formulation gives it the feature they share.

References realization::Formulation::feature_id.

◆ set_model_type_name()

virtual void realization::Bmi_Formulation::set_model_type_name ( std::string type_name)
inlineprotectedvirtual

Set the name of the specific type of the backing model object.

Parameters
type_nameThe name of the backing model object's type.

References model_type_name.

Referenced by realization::Bmi_Multi_Formulation::create_multi_formulation(), and realization::Bmi_Module_Formulation::inner_create_formulation().

◆ set_output_header_fields()

void realization::Bmi_Formulation::set_output_header_fields ( const std::vector< std::string > & output_headers)
inlineprotected

◆ set_output_variable_names()

void realization::Bmi_Formulation::set_output_variable_names ( const std::vector< std::string > & out_var_names)
inlineprotected

Set the names of variables in formulation output.

Set the names of the variables to include in the output from this formulation, which should be some ordered subset of the output variables from the model.

Parameters
out_var_namesthe names of variables in formulation output, in the order they should appear.

References output_variable_names.

Referenced by realization::Bmi_Multi_Formulation::create_multi_formulation(), and realization::Bmi_Module_Formulation::inner_create_formulation().

◆ update()

void realization::Bmi_Formulation::update ( time_step_t t_index,
time_step_t t_delta )
overridepure virtual

Advance the backing model formulation through the given time step.

Parameters
t_indexThe index of the time step to run.
t_deltaThe duration, in seconds, of that time step.

Implements realization::Formulation.

Implemented in realization::Bmi_Module_Formulation, and realization::Bmi_Multi_Formulation.

◆ validate_parameters()

Friends And Related Symbol Documentation

◆ ::Bmi_C_Formulation_Test

friend class ::Bmi_C_Formulation_Test
friend

◆ ::Bmi_Formulation_Test

friend class ::Bmi_Formulation_Test
friend

Member Data Documentation

◆ bmi_main_output_var

std::string realization::Bmi_Formulation::bmi_main_output_var
private

◆ compound_id_

std::string realization::Bmi_Formulation::compound_id_
private

Explicit compound identity override.

Empty string signals the default <id>:<model_type_name> in compound_id().

Referenced by compound_id(), and set_compound_id().

◆ feature_id

std::string realization::Formulation::feature_id
privateinherited

◆ forcing

◆ id

std::string realization::Formulation::id
protectedinherited

This formulation's locator; see get_id.

Referenced by realization::Formulation::get_id().

◆ model_type_name

std::string realization::Bmi_Formulation::model_type_name
private

◆ OPTIONAL_PARAMETERS

const std::vector< std::string > realization::Bmi_Formulation::OPTIONAL_PARAMETERS
staticprivate
Initial value:
= {
BMI_REALIZATION_CFG_PARAM_OPT__USES_FORCINGS
BMI_REALIZATION_CFG_PARAM_OPT__FORCING_FILE,
BMI_REALIZATION_CFG_PARAM_OPT__VAR_STD_NAMES,
BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS,
BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS,
BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END,
BMI_REALIZATION_CFG_PARAM_OPT__FIXED_TIME_STEP,
BMI_REALIZATION_CFG_PARAM_OPT__LIB_FILE
}

◆ output_header_fields

std::vector<std::string> realization::Bmi_Formulation::output_header_fields
private

Output header field strings corresponding to the variables output by the realization, as defined in output_variable_names.

Referenced by get_output_header_field_names(), and set_output_header_fields().

◆ output_variable_names

std::vector<std::string> realization::Bmi_Formulation::output_variable_names
private

Names of the variables to include in the output from this formulation, which will be some ordered subset of the BMI module output variables accessible to the instance.

Referenced by get_output_variable_names(), and set_output_variable_names().

◆ REQUIRED_PARAMETERS

const std::vector< std::string > realization::Bmi_Formulation::REQUIRED_PARAMETERS
staticprivate
Initial value:
= {
BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG,
BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR,
BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE,
}

Referenced by get_required_parameters().


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