|
NGen
|
#include <Formulation_Manager.hpp>
Collaboration diagram for realization::Formulation_Manager:Public Member Functions | |
| Formulation_Manager (boost::property_tree::ptree loaded_tree) | |
| ~Formulation_Manager ()=default | |
| void | read (simulation_time_params &simulation_time_config, geojson::GeoJSON fabric) |
| void | add_formulation (std::shared_ptr< Catchment_Formulation > formulation) |
| std::shared_ptr< Catchment_Formulation > | get_formulation (std::string id) const |
| std::shared_ptr< Catchment_Formulation > | get_domain_formulation (long id) const |
| bool | has_domain_formulation (int id) const |
| bool | contains (std::string identifier) const |
| int | get_size () |
| bool | is_empty () |
| const realization::config::Output & | get_output_config () const |
| The parsed output configuration block. | |
| std::map< std::string, std::shared_ptr< Catchment_Formulation > >::const_iterator | begin () const |
| std::map< std::string, std::shared_ptr< Catchment_Formulation > >::const_iterator | end () const |
| bool | get_using_routing () |
| std::string | get_t_route_config_file_with_path () |
| void | finalize () |
| Release any resources that should not be held as the run is shutting down. | |
| void | initialize_output_config () |
| Parse the output configuration from the realization tree (preferring the "output" block, falling back to the deprecated top-level keys), warn on deprecated usage, and validate build support. | |
| ngen::LayerDataStorage & | get_layer_metadata () |
| return the layer storage used for formulations | |
Protected Member Functions | |
| std::shared_ptr< Catchment_Formulation > | construct_formulation_from_config (simulation_time_params &simulation_time_config, std::string identifier, realization::config::Config &catchment_formulation) |
| std::shared_ptr< Catchment_Formulation > | construct_missing_formulation (geojson::Feature &feature, simulation_time_params &simulation_time_config) |
| forcing_params | get_forcing_params (const geojson::PropertyMap &forcing_prop_map, std::string identifier, simulation_time_params &simulation_time_config) |
| void | parse_external_model_params (boost::property_tree::ptree &model_params, const geojson::Feature catchment_feature) |
Parse a model_params property tree and replace external parameters with values from a catchment's properties. | |
| void | parse_external_model_params (geojson::PropertyMap &model_params, const geojson::Feature catchment_feature) |
Parse a model_params property map and replace external parameters with values from a catchment's properties. | |
Protected Attributes | |
| boost::property_tree::ptree | tree |
| realization::config::Config | global_config |
| geojson::PropertyMap | global_configs |
| Parsed realization-level config blocks that should be inherited into every formulation's params unless the formulation declares its own. | |
| std::map< std::string, std::shared_ptr< Catchment_Formulation > > | formulations |
| std::map< int, std::shared_ptr< Catchment_Formulation > > | domain_formulations |
| std::shared_ptr< routing_params > | routing_config |
| bool | using_routing = false |
| realization::config::Output | output_config |
| ngen::LayerDataStorage | layer_storage |
| Formulation_Manager::Formulation_Manager | ( | boost::property_tree::ptree | loaded_tree | ) |
References initialize_output_config().
|
default |
| void Formulation_Manager::add_formulation | ( | std::shared_ptr< Catchment_Formulation > | formulation | ) |
References formulations.
Referenced by read().
| std::map< std::string, std::shared_ptr< Catchment_Formulation > >::const_iterator Formulation_Manager::begin | ( | ) | const |
References formulations.
|
protected |
References realization::config::apply_config(), realization::Catchment_Formulation::config_pattern_substitution(), realization::construct_formulation(), realization::config::Config::forcing, realization::config::Config::formulation, realization::formulation_exists(), get_forcing_params(), global_configs, realization::config::Forcing::has_key(), realization::config::Forcing::parameters, realization::config::Formulation::parameters, realization::config::SERIALIZATION, realization::config::Formulation::type, and realization::valid_formulation_keys().
Referenced by read().
|
protected |
References realization::config::apply_config(), realization::Catchment_Formulation::config_pattern_substitution(), realization::construct_formulation(), realization::config::Config::forcing, realization::config::Config::formulation, get_forcing_params(), global_config, global_configs, realization::config::Forcing::parameters, realization::config::Formulation::parameters, realization::config::SERIALIZATION, and realization::config::Formulation::type.
Referenced by read().
| bool Formulation_Manager::contains | ( | std::string | identifier | ) | const |
References formulations.
Referenced by read().
| std::map< std::string, std::shared_ptr< Catchment_Formulation > >::const_iterator Formulation_Manager::end | ( | ) | const |
References formulations.
| void Formulation_Manager::finalize | ( | ) |
Release any resources that should not be held as the run is shutting down.
In particular, this should be called before MPI_Finalize()
References domain_formulations, and formulations.
| std::shared_ptr< Catchment_Formulation > Formulation_Manager::get_domain_formulation | ( | long | id | ) | const |
References domain_formulations.
|
protected |
References simulation_time_params::end_time, and simulation_time_params::start_time.
Referenced by construct_formulation_from_config(), and construct_missing_formulation().
| std::shared_ptr< Catchment_Formulation > Formulation_Manager::get_formulation | ( | std::string | id | ) | const |
References formulations.
| ngen::LayerDataStorage & Formulation_Manager::get_layer_metadata | ( | ) |
return the layer storage used for formulations
References layer_storage.
| const realization::config::Output & Formulation_Manager::get_output_config | ( | ) | const |
The parsed output configuration block.
References output_config.
| int Formulation_Manager::get_size | ( | ) |
References formulations.
| std::string Formulation_Manager::get_t_route_config_file_with_path | ( | ) |
References routing_config, and routing_params::t_route_config_file_with_path.
| bool Formulation_Manager::get_using_routing | ( | ) |
References using_routing.
| bool Formulation_Manager::has_domain_formulation | ( | int | id | ) | const |
References domain_formulations.
| void Formulation_Manager::initialize_output_config | ( | ) |
Parse the output configuration from the realization tree (preferring the "output" block, falling back to the deprecated top-level keys), warn on deprecated usage, and validate build support.
Called once at construction so output accessors are valid before read().
References realization::config::OutputDomain::format, realization::config::Output::from_legacy_keys, realization::config::Output::from_realization(), realization::config::netcdf, realization::config::Output::nexus, output_config, and tree.
Referenced by Formulation_Manager().
| bool Formulation_Manager::is_empty | ( | ) |
References formulations.
|
protected |
Parse a model_params property tree and replace external parameters with values from a catchment's properties.
| model_params | Property tree with root key "model_params" |
| catchment_feature | Associated catchment feature |
References geojson::Boolean, geojson::List, geojson::Natural, geojson::Object, geojson::Real, and geojson::String.
|
protected |
Parse a model_params property map and replace external parameters with values from a catchment's properties.
| model_params | Property map with root key "model_params" |
| catchment_feature | Associated catchment feature |
References geojson::Boolean, geojson::List, geojson::Natural, geojson::Object, geojson::Real, and geojson::String.
| void Formulation_Manager::read | ( | simulation_time_params & | simulation_time_config, |
| geojson::GeoJSON | fabric ) |
Read the layer descriptions
Read routing configurations from configuration file
Read catchment configurations from configuration file
References add_formulation(), realization::config::apply_serialization_path_token_resolution(), realization::config::apply_serialization_restore_subset_default(), construct_formulation_from_config(), construct_missing_formulation(), contains(), domain_formulations, realization::config::OutputDomain::format, realization::config::Config::formulation, realization::config::Layer::formulation, realization::config::Layer::get_descriptor(), realization::config::Layer::get_domain(), global_config, global_configs, realization::config::Config::has_formulation(), realization::config::Layer::has_formulation(), ngen::LayerDescription::id, layer_storage, realization::config::Formulation::link_external(), realization::config::netcdf, realization::config::Output::nexus, output_config, ngen::LayerDataStorage::put_layer(), routing_config, realization::config::SERIALIZATION, realization::config::to_key_string(), tree, and using_routing.
|
protected |
Referenced by finalize(), get_domain_formulation(), has_domain_formulation(), and read().
|
protected |
Referenced by add_formulation(), begin(), contains(), end(), finalize(), get_formulation(), get_size(), and is_empty().
|
protected |
Referenced by construct_missing_formulation(), and read().
|
protected |
Parsed realization-level config blocks that should be inherited into every formulation's params unless the formulation declares its own.
Keyed by the JSON key string (see realization::config::GlobalConfigKey).
Referenced by construct_formulation_from_config(), construct_missing_formulation(), and read().
|
protected |
Referenced by get_layer_metadata(), and read().
|
protected |
Referenced by get_output_config(), initialize_output_config(), and read().
|
protected |
Referenced by get_t_route_config_file_with_path(), and read().
|
protected |
Referenced by initialize_output_config(), and read().
|
protected |
Referenced by get_using_routing(), and read().