From 4b951bc303ebf28eeea56629211826e215dbfa43 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 25 Mar 2024 15:10:21 +0000 Subject: [PATCH] Commiting Documentation --- ...lities_2mdarray_2mdarray_8hpp-example.html | 2 +- _abstract_c_lib_bmi_adapter_8hpp_source.html | 12 +- _aorc_forcing_8hpp_source.html | 2 +- _async_data_provider_8hpp_source.html | 2 +- _bmi___adapter_8hpp_source.html | 267 +- _bmi___c___adapter_8hpp_source.html | 16 +- _bmi___c___formulation_8hpp_source.html | 114 +- _bmi___cpp___adapter_8hpp_source.html | 18 +- _bmi___cpp___formulation_8hpp_source.html | 100 +- _bmi___formulation_8hpp_source.html | 2 +- _bmi___fortran___adapter_8hpp_source.html | 2 +- _bmi___fortran___common_8h_source.html | 2 +- _bmi___fortran___formulation_8hpp_source.html | 59 +- _bmi___module___formulation_8hpp_source.html | 1248 ++------ _bmi___multi___formulation_8hpp_source.html | 1049 +++---- _bmi___py___adapter_8hpp_source.html | 2 +- _bmi___py___formulation_8hpp_source.html | 63 +- _c_s_v___reader_8h_source.html | 2 +- _catchment___formulation_8hpp_source.html | 2 +- _collection_feature_8hpp_source.html | 2 +- _configuration_exception_8hpp_source.html | 2 +- _constants_8h_source.html | 2 +- ..._feature_forcing_provider_8hpp_source.html | 2 +- _data_provider_8hpp_source.html | 2 +- _data_provider_selectors_8hpp_source.html | 2 +- _deferred_wrapped_provider_8hpp_source.html | 2 +- _endian_copy_8hpp_source.html | 2 +- ...nal_integration_exception_8hpp_source.html | 2 +- _feature_base_8hpp_source.html | 2 +- _feature_builder_8hpp_source.html | 2 +- _feature_collection_8hpp_source.html | 2 +- _feature_visitor_8hpp_source.html | 2 +- _features_8hpp_source.html | 2 +- _file_checker_8h_source.html | 2 +- _file_stream_handler_8hpp_source.html | 2 +- _formulation___constructors_8hpp_source.html | 186 +- _formulation___manager_8hpp_source.html | 8 +- _g_m___object_8hpp_source.html | 2 +- _generic_data_provider_8hpp_source.html | 2 +- _grid_polygon_8hpp_source.html | 2 +- ..._cartographic_realization_8hpp_source.html | 2 +- _h_y___catchment_8hpp_source.html | 2 +- _h_y___catchment_aggregate_8hpp_source.html | 2 +- _h_y___catchment_area_8hpp_source.html | 2 +- _h_y___catchment_divide_8hpp_source.html | 2 +- _h_y___catchment_realization_8hpp_source.html | 2 +- _h_y___dendritic_catchment_8hpp_source.html | 2 +- _h_y___distance_discription_8hpp_source.html | 2 +- _h_y___features_8hpp_source.html | 2 +- _h_y___features___ids_8hpp_source.html | 2 +- _h_y___features___m_p_i_8hpp_source.html | 5 +- _h_y___flow_path_8hpp_source.html | 2 +- _h_y___hydro_feature_8hpp_source.html | 2 +- _h_y___hydro_location_8hpp_source.html | 2 +- _h_y___hydro_location_type_8hpp_source.html | 2 +- _h_y___hydro_network_8hpp_source.html | 2 +- _h_y___hydro_nexus_8hpp_source.html | 2 +- _h_y___indirect_position_8hpp_source.html | 2 +- _h_y___interior_catchment_8hpp_source.html | 2 +- _h_y___point_hydro_nexus_8hpp_source.html | 2 +- ..._point_hydro_nexus_remote_8hpp_source.html | 2 +- _hydrofabric_subsetter_8hpp_source.html | 2 +- _interpreter_util_8hpp_source.html | 2 +- _j_s_o_n_geometry_8hpp_source.html | 2 +- _j_s_o_n_property_8hpp_source.html | 2 +- _layer_8hpp_source.html | 2 +- _layer_data_8hpp_source.html | 2 +- _line_string_feature_8hpp_source.html | 2 +- _multi_line_string_feature_8hpp_source.html | 2 +- _multi_point_feature_8hpp_source.html | 2 +- _multi_polygon_feature_8hpp_source.html | 2 +- ...per_feature_data_provider_8hpp_source.html | 2 +- _nexus___manager_8hpp_source.html | 2 +- _null_forcing_provider_8hpp_source.html | 2 +- ...nal_wrapped_data_provider_8hpp_source.html | 2 +- _partition___data_8hpp_source.html | 2 +- _partition___one_8hpp_source.html | 2 +- _partition___parser_8hpp_source.html | 2 +- _point_feature_8hpp_source.html | 2 +- _polygon_feature_8hpp_source.html | 2 +- _routing___params_8h_source.html | 2 +- _routing___py___adapter_8hpp_source.html | 2 +- _simulation___time_8hpp_source.html | 2 +- _state___exception_8hpp_source.html | 2 +- _stream_handler_8hpp_source.html | 2 +- _surface_layer_8hpp_source.html | 2 +- _units_helper_8hpp_source.html | 2 +- _wrapped_data_provider_8hpp_source.html | 2 +- all_8h_source.html | 2 +- annotated.html | 2 +- bmi_8h_source.html | 2 +- bmi_8hpp_source.html | 2 +- bmi__utilities_8hpp_source.html | 4 +- catchment_2formulation_8hpp_source.html | 2 +- class_b_m_i_data_selector-members.html | 2 +- class_b_m_i_data_selector.html | 10 +- class_c_s_v_data_selector-members.html | 2 +- class_c_s_v_data_selector.html | 10 +- class_c_s_v_reader-members.html | 2 +- class_c_s_v_reader.html | 2 +- ..._catchment_aggr_data_selector-members.html | 2 +- class_catchment_aggr_data_selector.html | 10 +- ..._per_feature_forcing_provider-members.html | 2 +- class_csv_per_feature_forcing_provider.html | 2 +- class_feature___test-members.html | 2 +- class_feature___test.html | 2 +- class_feature_collection___test-members.html | 2 +- class_feature_collection___test.html | 2 +- class_g_m___object-members.html | 2 +- class_g_m___object.html | 2 +- class_g_m___object__inherit__graph.map | 52 +- class_g_m___object__inherit__graph.md5 | 2 +- class_g_m___object__inherit__graph.svg | 1410 ++++----- class_g_m___object__inherit__graph_org.svg | 1410 ++++----- ..._y___cartographic_realization-members.html | 2 +- class_h_y___cartographic_realization.html | 4 +- class_h_y___catchment-members.html | 2 +- class_h_y___catchment.html | 2 +- class_h_y___catchment_aggregate-members.html | 2 +- class_h_y___catchment_aggregate.html | 2 +- class_h_y___catchment_area-members.html | 2 +- class_h_y___catchment_area.html | 6 +- ...s_h_y___catchment_area__inherit__graph.map | 40 +- ...s_h_y___catchment_area__inherit__graph.md5 | 2 +- ...s_h_y___catchment_area__inherit__graph.svg | 1220 +++----- ...y___catchment_area__inherit__graph_org.svg | 1220 +++----- class_h_y___catchment_divide-members.html | 2 +- class_h_y___catchment_divide.html | 4 +- ...s_h_y___catchment_realization-members.html | 2 +- class_h_y___catchment_realization.html | 4 +- ..._catchment_realization__inherit__graph.map | 52 +- ..._catchment_realization__inherit__graph.md5 | 2 +- ..._catchment_realization__inherit__graph.svg | 1372 ++++----- ...chment_realization__inherit__graph_org.svg | 1372 ++++----- class_h_y___dendritic_catchment-members.html | 2 +- class_h_y___dendritic_catchment.html | 2 +- class_h_y___flow_path-members.html | 2 +- class_h_y___flow_path.html | 4 +- class_h_y___hydro_feature-members.html | 2 +- class_h_y___hydro_feature.html | 2 +- class_h_y___hydro_network-members.html | 2 +- class_h_y___hydro_network.html | 4 +- class_h_y___hydro_nexus-members.html | 2 +- class_h_y___hydro_nexus.html | 2 +- class_h_y___interior_catchment-members.html | 2 +- class_h_y___interior_catchment.html | 2 +- class_h_y___point_hydro_nexus-members.html | 2 +- class_h_y___point_hydro_nexus.html | 2 +- class_j_s_o_n_geometry___test-members.html | 2 +- class_j_s_o_n_geometry___test.html | 2 +- class_j_s_o_n_property___test-members.html | 2 +- class_j_s_o_n_property___test.html | 2 +- class_multi_layer_parser_test-members.html | 2 +- class_multi_layer_parser_test.html | 2 +- class_network___test-members.html | 2 +- class_network___test.html | 2 +- class_network___test1-members.html | 2 +- class_network___test1.html | 2 +- class_network___test2-members.html | 2 +- class_network___test2.html | 2 +- class_nexus___remote___test-members.html | 2 +- class_nexus___remote___test.html | 2 +- class_nexus___test-members.html | 2 +- class_nexus___test.html | 2 +- class_null_forcing_provider-members.html | 2 +- class_null_forcing_provider.html | 2 +- class_partition___one-members.html | 2 +- class_partition___one.html | 2 +- class_reservoir_kernel_test-members.html | 2 +- class_reservoir_kernel_test.html | 2 +- ...eservoir_timeless_kernel_test-members.html | 2 +- class_reservoir_timeless_kernel_test.html | 2 +- class_simulation___time-members.html | 2 +- class_simulation___time.html | 2 +- class_units_helper-members.html | 2 +- class_units_helper.html | 6 +- class_units_helper___test-members.html | 2 +- class_units_helper___test.html | 2 +- class_visitor-members.html | 2 +- class_visitor.html | 2 +- classbmi_1_1_bmi-members.html | 2 +- classbmi_1_1_bmi.html | 2 +- classbmi_1_1_bmi__inherit__graph.map | 14 +- classbmi_1_1_bmi__inherit__graph.md5 | 2 +- classbmi_1_1_bmi__inherit__graph.svg | 112 +- classbmi_1_1_bmi__inherit__graph_org.svg | 114 +- ...ccess_1_1_async_data_provider-members.html | 2 +- ...sdata__access_1_1_async_data_provider.html | 22 +- ...ata__access_1_1_data_provider-members.html | 2 +- classdata__access_1_1_data_provider.html | 22 +- ...cess_1_1_data_provider__inherit__graph.map | 34 +- ...cess_1_1_data_provider__inherit__graph.md5 | 2 +- ...cess_1_1_data_provider__inherit__graph.svg | 1634 +++++------ ..._1_1_data_provider__inherit__graph_org.svg | 1634 +++++------ ...1_1_deferred_wrapped_provider-members.html | 2 +- ..._access_1_1_deferred_wrapped_provider.html | 2 +- ...ess_1_1_generic_data_provider-members.html | 2 +- ...ata__access_1_1_generic_data_provider.html | 18 +- ..._generic_data_provider__inherit__graph.map | 34 +- ..._generic_data_provider__inherit__graph.md5 | 2 +- ..._generic_data_provider__inherit__graph.svg | 1596 +++++----- ...eric_data_provider__inherit__graph_org.svg | 1596 +++++----- ...ptional_wrapped_data_provider-members.html | 2 +- ...ss_1_1_optional_wrapped_data_provider.html | 2 +- ...ess_1_1_wrapped_data_provider-members.html | 2 +- ...ata__access_1_1_wrapped_data_provider.html | 2 +- classes.html | 2 +- ...xternal_integration_exception-members.html | 2 +- ...al_1_1_external_integration_exception.html | 2 +- ...eojson_1_1_collection_feature-members.html | 2 +- classgeojson_1_1_collection_feature.html | 2 +- classgeojson_1_1_feature_base-members.html | 2 +- classgeojson_1_1_feature_base.html | 2 +- ...eojson_1_1_feature_collection-members.html | 2 +- classgeojson_1_1_feature_collection.html | 2 +- classgeojson_1_1_feature_visitor-members.html | 2 +- classgeojson_1_1_feature_visitor.html | 2 +- ...sgeojson_1_1_j_s_o_n_property-members.html | 2 +- classgeojson_1_1_j_s_o_n_property.html | 2 +- ...ojson_1_1_line_string_feature-members.html | 2 +- classgeojson_1_1_line_string_feature.html | 2 +- ...1_1_multi_line_string_feature-members.html | 2 +- ...geojson_1_1_multi_line_string_feature.html | 2 +- ...ojson_1_1_multi_point_feature-members.html | 2 +- classgeojson_1_1_multi_point_feature.html | 2 +- ...son_1_1_multi_polygon_feature-members.html | 2 +- classgeojson_1_1_multi_polygon_feature.html | 2 +- classgeojson_1_1_point_feature-members.html | 2 +- classgeojson_1_1_point_feature.html | 2 +- classgeojson_1_1_polygon_feature-members.html | 2 +- classgeojson_1_1_polygon_feature.html | 2 +- ...__features_1_1_h_y___features-members.html | 2 +- classhy__features_1_1_h_y___features.html | 2 +- ...tion_1_1_h_y___hydro_location-members.html | 2 +- ...ydrolocation_1_1_h_y___hydro_location.html | 2 +- ...n_1_1_h_y___indirect_position-members.html | 2 +- ...olocation_1_1_h_y___indirect_position.html | 2 +- ..._1_abstract_c_lib_bmi_adapter-members.html | 23 +- ...1_1bmi_1_1_abstract_c_lib_bmi_adapter.html | 35 +- ...s_1_1bmi_1_1_abstract_c_lib_bmi_adapter.js | 1 + ...bstract_c_lib_bmi_adapter__coll__graph.map | 18 +- ...bstract_c_lib_bmi_adapter__coll__graph.md5 | 2 +- ...bstract_c_lib_bmi_adapter__coll__graph.svg | 406 +-- ...act_c_lib_bmi_adapter__coll__graph_org.svg | 408 +-- ...ract_c_lib_bmi_adapter__inherit__graph.map | 14 +- ...ract_c_lib_bmi_adapter__inherit__graph.md5 | 2 +- ...ract_c_lib_bmi_adapter__inherit__graph.svg | 112 +- ..._c_lib_bmi_adapter__inherit__graph_org.svg | 114 +- ...dels_1_1bmi_1_1_bmi___adapter-members.html | 21 +- classmodels_1_1bmi_1_1_bmi___adapter.html | 35 +- classmodels_1_1bmi_1_1_bmi___adapter.js | 1 + ..._1_1bmi_1_1_bmi___adapter__coll__graph.map | 8 +- ..._1_1bmi_1_1_bmi___adapter__coll__graph.md5 | 2 +- ..._1_1bmi_1_1_bmi___adapter__coll__graph.svg | 392 +-- ...bmi_1_1_bmi___adapter__coll__graph_org.svg | 394 +-- ...1bmi_1_1_bmi___adapter__inherit__graph.map | 14 +- ...1bmi_1_1_bmi___adapter__inherit__graph.md5 | 2 +- ...1bmi_1_1_bmi___adapter__inherit__graph.svg | 112 +- ..._1_1_bmi___adapter__inherit__graph_org.svg | 114 +- ..._1_1bmi_1_1_bmi___c___adapter-members.html | 4 +- classmodels_1_1bmi_1_1_bmi___c___adapter.html | 12 +- ...bmi_1_1_bmi___c___adapter__coll__graph.map | 26 +- ...bmi_1_1_bmi___c___adapter__coll__graph.md5 | 2 +- ...bmi_1_1_bmi___c___adapter__coll__graph.svg | 508 ++-- ...1_1_bmi___c___adapter__coll__graph_org.svg | 510 ++-- ..._1_1_bmi___c___adapter__inherit__graph.map | 10 +- ..._1_1_bmi___c___adapter__inherit__graph.md5 | 2 +- ..._1_1_bmi___c___adapter__inherit__graph.svg | 112 +- ..._bmi___c___adapter__inherit__graph_org.svg | 114 +- ..._1bmi_1_1_bmi___cpp___adapter-members.html | 4 +- ...models_1_1bmi_1_1_bmi___cpp___adapter.html | 12 +- ...i_1_1_bmi___cpp___adapter__coll__graph.map | 32 +- ...i_1_1_bmi___cpp___adapter__coll__graph.md5 | 2 +- ...i_1_1_bmi___cpp___adapter__coll__graph.svg | 448 +-- ...1_bmi___cpp___adapter__coll__graph_org.svg | 450 +-- ..._1_bmi___cpp___adapter__inherit__graph.map | 10 +- ..._1_bmi___cpp___adapter__inherit__graph.md5 | 2 +- ..._1_bmi___cpp___adapter__inherit__graph.svg | 112 +- ...mi___cpp___adapter__inherit__graph_org.svg | 114 +- ...xternal_1_1_state___exception-members.html | 2 +- ...els_1_1external_1_1_state___exception.html | 2 +- classnetwork_1_1_network-members.html | 2 +- classnetwork_1_1_network.html | 2 +- classnexus_1_1_nexus___manager-members.html | 2 +- classnexus_1_1_nexus___manager.html | 2 +- classngen_1_1_layer-members.html | 2 +- classngen_1_1_layer.html | 2 +- classngen_1_1_layer_data_storage-members.html | 2 +- classngen_1_1_layer_data_storage.html | 2 +- classngen_1_1_surface_layer-members.html | 2 +- classngen_1_1_surface_layer.html | 2 +- classngen_1_1mdarray-members.html | 2 +- classngen_1_1mdarray.html | 2 +- classngen_1_1mdframe-members.html | 2 +- classngen_1_1mdframe.html | 2 +- classngen_1_1sqlite_1_1database-members.html | 2 +- classngen_1_1sqlite_1_1database.html | 2 +- ...ion_1_1_bmi___c___formulation-members.html | 219 +- ...realization_1_1_bmi___c___formulation.html | 1160 ++++---- classrealization_1_1_bmi___c___formulation.js | 117 +- ...1_1_bmi___c___formulation__coll__graph.map | 255 +- ...1_1_bmi___c___formulation__coll__graph.md5 | 2 +- ...1_1_bmi___c___formulation__coll__graph.svg | 2568 +++++++---------- ...bmi___c___formulation__coll__graph_org.svg | 2568 +++++++---------- ..._bmi___c___formulation__inherit__graph.map | 11 +- ..._bmi___c___formulation__inherit__graph.md5 | 2 +- ..._bmi___c___formulation__inherit__graph.svg | 1018 +++---- ...___c___formulation__inherit__graph_org.svg | 1020 +++---- ...n_1_1_bmi___cpp___formulation-members.html | 219 +- ...alization_1_1_bmi___cpp___formulation.html | 1175 ++++---- ...realization_1_1_bmi___cpp___formulation.js | 117 +- ...1_bmi___cpp___formulation__coll__graph.map | 254 +- ...1_bmi___cpp___formulation__coll__graph.md5 | 2 +- ...1_bmi___cpp___formulation__coll__graph.svg | 2479 +++++++--------- ...i___cpp___formulation__coll__graph_org.svg | 2479 +++++++--------- ...mi___cpp___formulation__inherit__graph.map | 11 +- ...mi___cpp___formulation__inherit__graph.md5 | 2 +- ...mi___cpp___formulation__inherit__graph.svg | 1018 +++---- ..._cpp___formulation__inherit__graph_org.svg | 1020 +++---- ...ization_1_1_bmi___formulation-members.html | 2 +- classrealization_1_1_bmi___formulation.html | 86 +- ..._1_1_bmi___formulation__inherit__graph.map | 56 +- ..._1_1_bmi___formulation__inherit__graph.md5 | 2 +- ..._1_1_bmi___formulation__inherit__graph.svg | 1434 ++++----- ..._bmi___formulation__inherit__graph_org.svg | 1434 ++++----- ..._1_bmi___module___formulation-members.html | 188 +- ...zation_1_1_bmi___module___formulation.html | 1394 ++++----- ...lization_1_1_bmi___module___formulation.js | 124 +- ...mi___module___formulation__coll__graph.map | 217 +- ...mi___module___formulation__coll__graph.md5 | 2 +- ...mi___module___formulation__coll__graph.svg | 1860 +++++++----- ..._module___formulation__coll__graph_org.svg | 1860 +++++++----- ...__module___formulation__inherit__graph.map | 16 +- ...__module___formulation__inherit__graph.md5 | 2 +- ...__module___formulation__inherit__graph.svg | 1232 ++++---- ...dule___formulation__inherit__graph_org.svg | 1234 ++++---- ...1_1_bmi___multi___formulation-members.html | 2 +- ...ization_1_1_bmi___multi___formulation.html | 32 +- ...n_1_1_catchment___formulation-members.html | 2 +- ...alization_1_1_catchment___formulation.html | 22 +- ...atchment___formulation__inherit__graph.map | 44 +- ...atchment___formulation__inherit__graph.md5 | 2 +- ...atchment___formulation__inherit__graph.svg | 1294 ++++----- ...ment___formulation__inherit__graph_org.svg | 1294 ++++----- ...n_1_1_configuration_exception-members.html | 2 +- ...alization_1_1_configuration_exception.html | 2 +- classrealization_1_1_formulation-members.html | 2 +- classrealization_1_1_formulation.html | 18 +- ...ion_1_1_formulation___manager-members.html | 2 +- ...realization_1_1_formulation___manager.html | 2 +- ...zation_1_1_formulation__inherit__graph.map | 32 +- ...zation_1_1_formulation__inherit__graph.md5 | 2 +- ...zation_1_1_formulation__inherit__graph.svg | 1174 +++----- ...on_1_1_formulation__inherit__graph_org.svg | 1174 +++----- classutils_1_1_file_checker-members.html | 2 +- classutils_1_1_file_checker.html | 2 +- ...utils_1_1_file_stream_handler-members.html | 2 +- classutils_1_1_file_stream_handler.html | 2 +- classutils_1_1_stream_handler-members.html | 2 +- classutils_1_1_stream_handler.html | 2 +- config_2formulation_8hpp_source.html | 2 +- config_8hpp_source.html | 2 +- dimension_8hpp_source.html | 2 +- dir_04adb1979c92d7af91c6eb3785371ebf.html | 2 +- dir_059da78dbc58f17e61b5750ff8b4fa5b.html | 2 +- dir_05feceea52065a7be26bda8c6013a2ab.html | 2 +- dir_06d176921b42a75382266fc4d2128276.html | 2 +- dir_102bca72b497334c3b5bafded849df31.html | 2 +- dir_109e5982e3c0905b9f6e65a4e88a7a8c.html | 2 +- dir_13e138d54eb8818da29c3992edef070a.html | 2 +- dir_14da12a9c0cad26f224c4c203007cac9.html | 2 +- dir_1a34ade7a8ced74dfa5d1494ffac178f.html | 2 +- dir_23df12f7bc050f2b7f4a461242b2c584.html | 2 +- dir_30cdb0ba73ec6aa07266999f59822b7b.html | 2 +- dir_32be280d50a68585aeaf5461aecee984.html | 2 +- dir_37fe149830521974d956964a619d45c1.html | 2 +- dir_3d69f64eaf81436fe2b22361382717e5.html | 2 +- dir_453640859cfc4e9268868ec6c20756ed.html | 2 +- dir_4dfb390932598a86fa1407fef820786c.html | 2 +- dir_52b4106b6168f13dcdf82e33b1d195ee.html | 2 +- dir_574e1ac650fad4e1c2a38c91f35e8c3c.html | 2 +- dir_5bea9f390e7a432a1b79aa466fef89f5.html | 2 +- dir_653ed63d62fa3b5c4f20bdbe070dc427.html | 2 +- dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- dir_733dcb5e19919fff8431e51daebf2dc1.html | 2 +- dir_7688c87f5c9cad4c135b176d94e89e38.html | 2 +- dir_7b5d38f1875f1b693f62ca6a108a1129.html | 2 +- dir_84131044e116705cc160ab6b506cfa4a.html | 2 +- dir_84b1212f0fba800e0394fab1e2815654.html | 2 +- dir_8d7380289754561ad9ab6b1ea0e13aa3.html | 2 +- dir_8dbd500a1ae0b3d23deb7285e2980d8b.html | 2 +- dir_9058ef7c383dff996c678c5ba80ec03e.html | 2 +- dir_a20fe13cb0ae0859963f605e03cbbde0.html | 2 +- dir_aebb8dcc11953d78e620bbef0b9e2183.html | 2 +- dir_af6c59cd395300265c7793330aabe59b.html | 2 +- dir_b47d70aee2f50874297b06a49059126a.html | 2 +- dir_b6385d8aa16c89d0e34e854039dabb8a.html | 2 +- dir_bbec9111c9aa9e6b087277fe2118a922.html | 2 +- dir_bbf261b6f865835050e81fc3d5b968be.html | 2 +- dir_bdd5cae0fbfefeae0f7cff5a63a5d9a3.html | 2 +- dir_c173984099e2516a16a1d7ede46cf1bc.html | 2 +- dir_c77a57266e2d7827e133786576651a71.html | 2 +- dir_c7b4a0481377b71e2d03b0bad3c56399.html | 2 +- dir_d25e7094c4a071584b7610f19585d20a.html | 2 +- dir_d44c64559bbebec7f509842c48db8b23.html | 2 +- dir_da5198fa48d662f25586daa4a65a29d1.html | 2 +- dir_daf6ef93866ae372f5c96086a457d64e.html | 2 +- dir_dc20cbb6c1e09bf64a485cbc043e5235.html | 2 +- dir_e68e8157741866f444e17edd764ebbae.html | 2 +- dir_e6dddece1f21430723523b5da5f62ed1.html | 2 +- dir_f1f56ea777d2b1579a7caa3bb14397f1.html | 2 +- dir_f1fb5e586ad9439bfa70c3e556fdbf17.html | 2 +- dir_f5322e06f39c724b7bf83af77f742c45.html | 2 +- examples.html | 2 +- forcing_8hpp_source.html | 2 +- functions.html | 12 +- functions__.html | 2 +- functions_a.html | 7 +- functions_b.html | 18 +- functions_c.html | 6 +- functions_d.html | 4 +- functions_e.html | 2 +- functions_eval.html | 2 +- functions_f.html | 4 +- functions_func.html | 3 +- functions_func_b.html | 4 +- functions_func_c.html | 6 +- functions_func_d.html | 4 +- functions_func_e.html | 2 +- functions_func_f.html | 2 +- functions_func_g.html | 54 +- functions_func_h.html | 2 +- functions_func_i.html | 17 +- functions_func_j.html | 2 +- functions_func_k.html | 2 +- functions_func_l.html | 2 +- functions_func_m.html | 2 +- functions_func_n.html | 2 +- functions_func_o.html | 2 +- functions_func_p.html | 2 +- functions_func_q.html | 2 +- functions_func_r.html | 4 +- functions_func_s.html | 22 +- functions_func_t.html | 2 +- functions_func_u.html | 2 +- functions_func_v.html | 2 +- functions_func_w.html | 2 +- functions_func_~.html | 4 +- functions_g.html | 50 +- functions_h.html | 2 +- functions_i.html | 19 +- functions_j.html | 2 +- functions_k.html | 2 +- functions_l.html | 6 +- functions_m.html | 4 +- functions_n.html | 4 +- functions_o.html | 4 +- functions_p.html | 2 +- functions_q.html | 2 +- functions_r.html | 6 +- functions_rela.html | 14 +- functions_s.html | 22 +- functions_t.html | 2 +- functions_type.html | 2 +- functions_u.html | 2 +- functions_v.html | 2 +- functions_vars.html | 2 +- functions_vars_a.html | 6 +- functions_vars_b.html | 14 +- functions_vars_c.html | 2 +- functions_vars_d.html | 2 +- functions_vars_e.html | 2 +- functions_vars_f.html | 4 +- functions_vars_g.html | 2 +- functions_vars_h.html | 2 +- functions_vars_i.html | 4 +- functions_vars_k.html | 2 +- functions_vars_l.html | 6 +- functions_vars_m.html | 4 +- functions_vars_n.html | 4 +- functions_vars_o.html | 4 +- functions_vars_p.html | 2 +- functions_vars_r.html | 4 +- functions_vars_s.html | 2 +- functions_vars_t.html | 2 +- functions_vars_u.html | 2 +- functions_vars_v.html | 2 +- functions_vars_w.html | 2 +- functions_w.html | 2 +- functions_~.html | 4 +- geopackage_8hpp_source.html | 2 +- graph_legend.html | 2 +- hierarchy.html | 10 +- hierarchy.js | 7 +- index.html | 2 +- inherit_graph_11.map | 14 +- inherit_graph_11.md5 | 2 +- inherit_graph_11.svg | 28 +- inherit_graph_13.map | 2 +- inherit_graph_13.md5 | 2 +- inherit_graph_13.svg | 4 +- inherit_graph_20.map | 8 +- inherit_graph_20.md5 | 2 +- inherit_graph_20.svg | 16 +- inherit_graph_21.map | 2 +- inherit_graph_21.md5 | 2 +- inherit_graph_21.svg | 4 +- inherit_graph_24.map | 28 +- inherit_graph_24.md5 | 2 +- inherit_graph_24.svg | 56 +- inherit_graph_31.map | 2 +- inherit_graph_31.md5 | 2 +- inherit_graph_31.svg | 4 +- inherit_graph_56.map | 2 +- inherit_graph_56.md5 | 2 +- inherit_graph_56.svg | 4 +- inherit_graph_9.map | 90 +- inherit_graph_9.md5 | 2 +- inherit_graph_9.svg | 392 ++- inherits.html | 4 +- iterator_8hpp_source.html | 2 +- logging__utils_8h_source.html | 2 +- md__c_h_a_n_g_e_l_o_g.html | 2 +- md__c_o_n_t_r_i_b_u_t_i_n_g.html | 2 +- md__i_n_s_t_a_l_l.html | 2 +- md__t_e_r_m_s.html | 2 +- md_doc_2_a_u_t_o_m_a_t_e_d___t_e_s_t.html | 2 +- md_doc_2_b_m_i___m_o_d_e_l_s.html | 2 +- md_doc_2_b_m_iconventions.html | 2 +- md_doc_2_b_u_i_l_d_s___a_n_d___c_m_a_k_e.html | 2 +- md_doc_2_d_e_p_e_n_d_e_n_c_i_e_s.html | 2 +- ...t_r_i_b_u_t_e_d___p_r_o_c_e_s_s_i_n_g.html | 2 +- md_doc_2_g_i_t___u_s_a_g_e.html | 2 +- md_doc_2_l_s_t_m___m_o_d_e_l.html | 2 +- md_doc_2_m_p_i___r_e_m_o_t_e___n_e_x_u_s.html | 2 +- md_doc_2_p_y_t_h_o_n___r_o_u_t_i_n_g.html | 2 +- ...lines__for___ngen___code___validation.html | 2 +- ...a_t_i_o_n___c_o_n_f_i_g_u_r_a_t_i_o_n.html | 2 +- md_doc_2glossary.html | 2 +- md_doc_2programming__standards.html | 2 +- md_doc_2references.html | 2 +- md_test_2_r_e_a_d_m_e.html | 2 +- mdarray_2mdarray_8hpp_source.html | 2 +- mdarray_8hpp_source.html | 2 +- mdframe_2mdframe_8hpp_source.html | 2 +- mdframe_8hpp_source.html | 2 +- menudata.js | 1 + namespacebmi.html | 2 +- namespacedata__access.html | 2 +- namespaceexternal.html | 2 +- namespacegeojson.html | 4 +- namespacehy__features.html | 2 +- namespacehy__features_1_1hydrolocation.html | 2 +- namespacehy__features_1_1identifiers.html | 2 +- namespacelogging.html | 4 +- namespacemembers.html | 10 +- namespacemembers_enum.html | 2 +- namespacemembers_eval.html | 2 +- namespacemembers_func.html | 10 +- namespacemembers_type.html | 4 +- namespacemembers_vars.html | 4 +- namespacemodels.html | 2 +- namespacemodels_1_1bmi.html | 2 +- namespacemodels_1_1bmi_1_1helper.html | 2 +- namespacemodels_1_1external.html | 2 +- namespacenetwork.html | 2 +- namespacenexus.html | 2 +- namespacengen.html | 2 +- namespacengen_1_1detail.html | 2 +- namespacengen_1_1detail_1_1visitors.html | 2 +- namespacengen_1_1geopackage.html | 2 +- namespacengen_1_1sqlite.html | 2 +- namespacengen_1_1srs.html | 2 +- namespacengen_1_1traits.html | 2 +- namespacerealization.html | 228 +- namespacerealization.js | 8 +- namespacerealization_1_1config.html | 2 +- namespaces.html | 2 +- namespaceutils.html | 2 +- navtreedata.js | 26 +- navtreeindex10.js | 124 +- navtreeindex11.js | 130 +- navtreeindex12.js | 418 +-- navtreeindex13.js | 456 +-- navtreeindex14.js | 344 +-- navtreeindex15.js | 254 +- navtreeindex16.js | 152 +- navtreeindex17.js | 50 +- navtreeindex18.js | 50 +- navtreeindex19.js | 118 +- navtreeindex2.js | 92 +- navtreeindex20.js | 162 +- navtreeindex21.js | 20 - navtreeindex3.js | 130 +- navtreeindex4.js | 118 +- navtreeindex5.js | 124 +- navtreeindex6.js | 144 +- navtreeindex7.js | 124 +- navtreeindex8.js | 200 +- navtreeindex9.js | 178 +- network_8hpp_source.html | 2 +- ngen__sqlite_8hpp_source.html | 2 +- pages.html | 2 +- parallel__utils_8h_source.html | 2 +- proj_8hpp_source.html | 2 +- routing_8hpp_source.html | 2 +- search/all_11.js | 8 +- search/all_12.js | 6 +- search/all_13.js | 2 +- search/all_14.js | 2 +- search/all_15.js | 4 +- search/all_17.js | 4 +- search/all_18.js | 20 +- search/all_20.js | 2 +- search/all_6.js | 6 +- search/all_7.js | 120 +- search/all_8.js | 8 +- search/all_9.js | 2 +- search/all_b.js | 6 +- search/all_c.js | 120 +- search/all_e.js | 22 +- search/classes_1.js | 8 +- search/enumvalues_9.js | 2 +- search/enumvalues_a.js | 4 +- search/enumvalues_d.js | 4 +- search/functions_0.js | 2 +- search/functions_1.js | 2 +- search/functions_11.js | 2 +- search/functions_12.js | 20 +- search/functions_17.js | 2 +- search/functions_2.js | 4 +- search/functions_3.js | 2 +- search/functions_6.js | 132 +- search/functions_8.js | 16 +- search/typedefs_2.js | 2 +- search/variables_1.js | 4 +- search/variables_10.js | 2 +- search/variables_2.js | 12 +- search/variables_6.js | 4 +- search/variables_9.js | 2 +- search/variables_b.js | 4 +- search/variables_c.js | 2 +- search/variables_d.js | 2 +- search/variables_e.js | 2 +- struct_a_o_r_c__data-members.html | 2 +- struct_a_o_r_c__data.html | 2 +- struct_bmi-members.html | 2 +- struct_bmi.html | 2 +- struct_partition_data-members.html | 2 +- struct_partition_data.html | 2 +- structadd__to__summed__nexus-members.html | 2 +- structadd__to__summed__nexus.html | 2 +- structcompleted__time__step-members.html | 2 +- structcompleted__time__step.html | 2 +- structforcing__params-members.html | 2 +- structforcing__params.html | 2 +- ...roperty_1_1_as_vector_visitor-members.html | 2 +- ..._s_o_n_property_1_1_as_vector_visitor.html | 2 +- structgeojson_1_1_list-members.html | 2 +- structgeojson_1_1_list.html | 2 +- structgeojson_1_1_object-members.html | 2 +- structgeojson_1_1_object.html | 2 +- ..._h_y___distance_from_referent-members.html | 2 +- ...tion_1_1_h_y___distance_from_referent.html | 2 +- ...tinvalid__downstream__request-members.html | 2 +- structinvalid__downstream__request.html | 2 +- structinvalid__time__step-members.html | 2 +- structinvalid__time__step.html | 2 +- ...ctnetwork_1_1_vertex_property-members.html | 2 +- structnetwork_1_1_vertex_property.html | 2 +- ...tnetwork_1_1preorder__visitor-members.html | 2 +- structnetwork_1_1preorder__visitor.html | 2 +- structngen_1_1_layer_description-members.html | 2 +- structngen_1_1_layer_description.html | 2 +- ...ctngen_1_1detail_1_1dimension-members.html | 2 +- structngen_1_1detail_1_1dimension.html | 2 +- ..._1detail_1_1dimension_1_1hash-members.html | 2 +- ...ctngen_1_1detail_1_1dimension_1_1hash.html | 2 +- structngen_1_1detail_1_1variable-members.html | 2 +- structngen_1_1detail_1_1variable.html | 2 +- ...1_1detail_1_1variable_1_1hash-members.html | 2 +- structngen_1_1detail_1_1variable_1_1hash.html | 2 +- ...il_1_1visitors_1_1mdarray__at-members.html | 2 +- ..._1_1detail_1_1visitors_1_1mdarray__at.html | 2 +- ..._1visitors_1_1mdarray__insert-members.html | 2 +- ...detail_1_1visitors_1_1mdarray__insert.html | 2 +- ..._1_1visitors_1_1mdarray__rank-members.html | 2 +- ..._1detail_1_1visitors_1_1mdarray__rank.html | 2 +- ...1_1visitors_1_1mdarray__shape-members.html | 2 +- ...1detail_1_1visitors_1_1mdarray__shape.html | 2 +- ..._1_1visitors_1_1mdarray__size-members.html | 2 +- ..._1detail_1_1visitors_1_1mdarray__size.html | 2 +- ...sitors_1_1to__string__visitor-members.html | 2 +- ...il_1_1visitors_1_1to__string__visitor.html | 2 +- structngen_1_1geopackage_1_1wkb-members.html | 2 +- structngen_1_1geopackage_1_1wkb.html | 2 +- ...1_1geopackage_1_1wkb_1_1wgs84-members.html | 2 +- structngen_1_1geopackage_1_1wkb_1_1wgs84.html | 2 +- ...ctngen_1_1mdarray_1_1iterator-members.html | 2 +- structngen_1_1mdarray_1_1iterator.html | 2 +- ...sqlite_1_1database_1_1deleter-members.html | 2 +- ...ngen_1_1sqlite_1_1database_1_1deleter.html | 2 +- ...qlite_1_1database_1_1iterator-members.html | 2 +- ...gen_1_1sqlite_1_1database_1_1iterator.html | 2 +- ...en_1_1sqlite_1_1sqlite__error-members.html | 2 +- structngen_1_1sqlite_1_1sqlite__error.html | 2 +- structngen_1_1srs_1_1epsg-members.html | 2 +- structngen_1_1srs_1_1epsg.html | 2 +- structngen_1_1traits_1_1bool__pack.html | 2 +- ...tngen_1_1traits_1_1type__list-members.html | 2 +- structngen_1_1traits_1_1type__list.html | 2 +- ...lization_1_1config_1_1_config-members.html | 2 +- structrealization_1_1config_1_1_config.html | 2 +- ...ization_1_1config_1_1_forcing-members.html | 2 +- structrealization_1_1config_1_1_forcing.html | 2 +- ...ion_1_1config_1_1_formulation-members.html | 2 +- ...realization_1_1config_1_1_formulation.html | 2 +- ...ization_1_1config_1_1_routing-members.html | 2 +- structrealization_1_1config_1_1_routing.html | 2 +- ...ealization_1_1config_1_1_time-members.html | 2 +- structrealization_1_1config_1_1_time.html | 2 +- ...ctrequest__from__empty__nexus-members.html | 2 +- structrequest__from__empty__nexus.html | 2 +- structrouting__params-members.html | 2 +- structrouting__params.html | 2 +- structsimulation__time__params-members.html | 2 +- structsimulation__time__params.html | 2 +- time_8hpp_source.html | 2 +- toc.xml | 733 +++-- todo.html | 2 +- traits_8hpp_source.html | 2 +- variable_8hpp_source.html | 2 +- visitors_8hpp_source.html | 2 +- wkb_8hpp_source.html | 2 +- 734 files changed, 28227 insertions(+), 35592 deletions(-) diff --git a/_2github_2workspace_2include_2utilities_2mdarray_2mdarray_8hpp-example.html b/_2github_2workspace_2include_2utilities_2mdarray_2mdarray_8hpp-example.html index 3cb761efc4..660e1af08e 100644 --- a/_2github_2workspace_2include_2utilities_2mdarray_2mdarray_8hpp-example.html +++ b/_2github_2workspace_2include_2utilities_2mdarray_2mdarray_8hpp-example.html @@ -290,7 +290,7 @@ diff --git a/_abstract_c_lib_bmi_adapter_8hpp_source.html b/_abstract_c_lib_bmi_adapter_8hpp_source.html index 489abe4a50..24a8e9e30f 100644 --- a/_abstract_c_lib_bmi_adapter_8hpp_source.html +++ b/_abstract_c_lib_bmi_adapter_8hpp_source.html @@ -292,11 +292,11 @@
void dynamic_library_load()
Dynamically load and obtain this instance's handle to the shared library.
Definition AbstractCLibBmiAdapter.hpp:79
AbstractCLibBmiAdapter(const std::string &type_name, std::string library_file_path, std::string bmi_init_config, std::string forcing_file_path, bool allow_exceed_end, bool has_fixed_time_step, std::string registration_func, utils::StreamHandler output)
Main public constructor.
Definition AbstractCLibBmiAdapter.hpp:28
Abstract adapter interface for C++ classes to interact with the essential aspects of external models ...
Definition Bmi_Adapter.hpp:19
-
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:235
-
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:224
-
utils::StreamHandler output
Definition Bmi_Adapter.hpp:241
-
std::string model_name
Definition Bmi_Adapter.hpp:240
-
std::string forcing_file_path
Definition Bmi_Adapter.hpp:233
+
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:242
+
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:231
+
utils::StreamHandler output
Definition Bmi_Adapter.hpp:248
+
std::string model_name
Definition Bmi_Adapter.hpp:247
+
std::string forcing_file_path
Definition Bmi_Adapter.hpp:240
static bool file_is_readable(std::string path)
Check whether the path provided points to an existing, readable file.
Definition FileChecker.h:90
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
void put(const DataType &val)
Serialize data onto the stored stream.
Definition StreamHandler.hpp:59
@@ -308,7 +308,7 @@ diff --git a/_aorc_forcing_8hpp_source.html b/_aorc_forcing_8hpp_source.html index fa40aea16c..b0df71b397 100644 --- a/_aorc_forcing_8hpp_source.html +++ b/_aorc_forcing_8hpp_source.html @@ -228,7 +228,7 @@ diff --git a/_async_data_provider_8hpp_source.html b/_async_data_provider_8hpp_source.html index 3eadc89d34..4fe1134631 100644 --- a/_async_data_provider_8hpp_source.html +++ b/_async_data_provider_8hpp_source.html @@ -130,7 +130,7 @@ diff --git a/_bmi___adapter_8hpp_source.html b/_bmi___adapter_8hpp_source.html index 7f2ab2c34c..10cc44d876 100644 --- a/_bmi___adapter_8hpp_source.html +++ b/_bmi___adapter_8hpp_source.html @@ -141,154 +141,157 @@
43 Bmi_Adapter(Bmi_Adapter const&) = delete;
44 Bmi_Adapter(Bmi_Adapter &&) = default;
45
-
- -
55 double value = 1.0;
-
56 std::string input_units = GetTimeUnits();
-
57 std::string output_units = "s";
-
58 return UnitsHelper::get_converted_value(input_units, value, output_units);
-
59 }
+
51 virtual bool is_model_initialized() = 0;
+
52
+
+ +
62 double value = 1.0;
+
63 std::string input_units = GetTimeUnits();
+
64 std::string output_units = "s";
+
65 return UnitsHelper::get_converted_value(input_units, value, output_units);
+
66 }
-
60
-
-
70 double convert_model_time_to_seconds(const double& model_time_val) {
-
71 return model_time_val * bmi_model_time_convert_factor;
-
72 }
+
67
+
+
77 double convert_model_time_to_seconds(const double& model_time_val) {
+
78 return model_time_val * bmi_model_time_convert_factor;
+
79 }
-
73
-
-
80 double convert_seconds_to_model_time(const double& seconds_val) {
-
81 return seconds_val / bmi_model_time_convert_factor;
-
82 }
+
80
+
+
87 double convert_seconds_to_model_time(const double& seconds_val) {
+
88 return seconds_val / bmi_model_time_convert_factor;
+
89 }
-
83
-
102 virtual const std::string get_analogous_cxx_type(const std::string &external_type_name,
-
103 const size_t item_size) = 0;
-
104
-
-
126 void Initialize() {
-
127 // If there was previous init attempt but w/ failure exception, throw runtime error and include previous
-
128 // message
-
129 errno = 0;
-
130 if (model_initialized && !init_exception_msg.empty()) {
-
131 throw std::runtime_error(
-
132 "Previous " + model_name + " init attempt had exception: \n\t" + init_exception_msg);
-
133 }
-
134 // If there was previous init attempt w/ (implicitly) no exception on previous attempt, just return
-
135 else if (model_initialized) {
-
136 return;
-
137 }
- -
139 init_exception_msg = "Cannot initialize " + model_name + " using unreadable file '"
-
140 + bmi_init_config + "'. Error: "+std::strerror(errno);;
-
141 throw std::runtime_error(init_exception_msg);
-
142 }
-
143 else {
-
144 try {
-
145 // TODO: make this same name as used with other testing (adjust name in docstring above also)
- -
147 // Make sure this is set to 'true' after this function call finishes
-
148 model_initialized = true;
- -
150 }
-
151 // Record the exception message before re-throwing to handle subsequent function calls properly
-
152 catch (std::exception& e) {
-
153 // Make sure this is set to 'true' after this function call finishes
-
154 model_initialized = true;
-
155 throw e;
-
156 }
-
157 }
-
158 }
+
90
+
109 virtual const std::string get_analogous_cxx_type(const std::string &external_type_name,
+
110 const size_t item_size) = 0;
+
111
+
+
133 void Initialize() {
+
134 // If there was previous init attempt but w/ failure exception, throw runtime error and include previous
+
135 // message
+
136 errno = 0;
+
137 if (model_initialized && !init_exception_msg.empty()) {
+
138 throw std::runtime_error(
+
139 "Previous " + model_name + " init attempt had exception: \n\t" + init_exception_msg);
+
140 }
+
141 // If there was previous init attempt w/ (implicitly) no exception on previous attempt, just return
+
142 else if (model_initialized) {
+
143 return;
+
144 }
+ +
146 init_exception_msg = "Cannot initialize " + model_name + " using unreadable file '"
+
147 + bmi_init_config + "'. Error: "+std::strerror(errno);;
+
148 throw std::runtime_error(init_exception_msg);
+
149 }
+
150 else {
+
151 try {
+
152 // TODO: make this same name as used with other testing (adjust name in docstring above also)
+ +
154 // Make sure this is set to 'true' after this function call finishes
+
155 model_initialized = true;
+ +
157 }
+
158 // Record the exception message before re-throwing to handle subsequent function calls properly
+
159 catch (std::exception& e) {
+
160 // Make sure this is set to 'true' after this function call finishes
+
161 model_initialized = true;
+
162 throw e;
+
163 }
+
164 }
+
165 }
-
159
-
-
178 void Initialize(std::string config_file) override {
-
179 if (config_file != bmi_init_config && model_initialized) {
-
180 throw std::runtime_error(
-
181 "Model init previously attempted; cannot change config from " + bmi_init_config + " to "
-
182 + config_file);
-
183 }
-
184
-
185 if (config_file != bmi_init_config && !model_initialized) {
-
186 output.put("Warning: initialization call changes model config from " + bmi_init_config + " to "
-
187 + config_file);
-
188 bmi_init_config = config_file;
-
189 }
-
190 try {
-
191 Initialize();
-
192 }
- -
194 throw e;
-
195 }
-
196 catch (std::exception &e) {
-
197 throw std::runtime_error(e.what());
-
198 }
-
199 }
+
166
+
+
185 void Initialize(std::string config_file) override {
+
186 if (config_file != bmi_init_config && model_initialized) {
+
187 throw std::runtime_error(
+
188 "Model init previously attempted; cannot change config from " + bmi_init_config + " to "
+
189 + config_file);
+
190 }
+
191
+
192 if (config_file != bmi_init_config && !model_initialized) {
+
193 output.put("Warning: initialization call changes model config from " + bmi_init_config + " to "
+
194 + config_file);
+
195 bmi_init_config = config_file;
+
196 }
+
197 try {
+
198 Initialize();
+
199 }
+ +
201 throw e;
+
202 }
+
203 catch (std::exception &e) {
+
204 throw std::runtime_error(e.what());
+
205 }
+
206 }
-
200
-
-
206 inline bool isInitialized() {
-
207 return model_initialized;
-
208 }
+
207
+
+
213 inline bool isInitialized() {
+
214 return model_initialized;
+
215 }
-
209
-
-
216 inline std::string get_model_name(){
-
217 return model_name;
-
218 }
+
216
+
+
223 inline std::string get_model_name(){
+
224 return model_name;
+
225 }
-
219
-
220 protected:
- -
224 std::string bmi_init_config;
- - -
230 std::shared_ptr<double> bmi_model_time_step_size = nullptr;
- -
233 std::string forcing_file_path;
- -
237 std::shared_ptr<std::vector<std::string>> input_var_names;
-
239 bool model_initialized = false;
-
240 std::string model_name;
- -
243 std::shared_ptr<std::vector<std::string>> output_var_names;
-
244
- -
254
-
255 };
+
226
+
227 protected:
+ +
231 std::string bmi_init_config;
+ + +
237 std::shared_ptr<double> bmi_model_time_step_size = nullptr;
+ +
240 std::string forcing_file_path;
+ +
244 std::shared_ptr<std::vector<std::string>> input_var_names;
+
246 bool model_initialized = false;
+
247 std::string model_name;
+ +
250 std::shared_ptr<std::vector<std::string>> output_var_names;
+
251
+ +
261
+
262 };
-
256 }
-
257}
-
258#endif //NGEN_BMI_ADAPTER_HPP
+
263 }
+
264}
+
265#endif //NGEN_BMI_ADAPTER_HPP
static double get_converted_value(const std::string &in_units, const double &value, const std::string &out_units)
Definition UnitsHelper.cpp:58
Definition bmi.hpp:31
virtual std::string GetTimeUnits()=0
Abstract adapter interface for C++ classes to interact with the essential aspects of external models ...
Definition Bmi_Adapter.hpp:19
Bmi_Adapter(std::string model_name, std::string bmi_init_config, std::string forcing_file_path, bool allow_exceed_end, bool has_fixed_time_step, utils::StreamHandler output)
Definition Bmi_Adapter.hpp:22
-
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:239
+
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:246
Bmi_Adapter(Bmi_Adapter const &)=delete
-
std::string get_model_name()
Get the model name.
Definition Bmi_Adapter.hpp:216
-
double bmi_model_time_convert_factor
Conversion factor for converting values for model time in model's unit type to equivalent in seconds.
Definition Bmi_Adapter.hpp:228
-
std::shared_ptr< std::vector< std::string > > input_var_names
Pointer to collection of input variable names for backing model, used by GetInputVarNames().
Definition Bmi_Adapter.hpp:237
-
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:235
-
bool isInitialized()
Get whether this instance has been initialized properly.
Definition Bmi_Adapter.hpp:206
-
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:224
-
bool bmi_model_uses_forcing_file
Whether this particular model implementation directly reads input data from the forcing file.
Definition Bmi_Adapter.hpp:232
-
void Initialize(std::string config_file) override
Initialize the wrapped BMI model object using the given config file and the object's Initialize funct...
Definition Bmi_Adapter.hpp:178
-
double get_time_convert_factor()
Determine backing model's time units and return an appropriate conversion factor.
Definition Bmi_Adapter.hpp:54
+
std::string get_model_name()
Get the model name.
Definition Bmi_Adapter.hpp:223
+
double bmi_model_time_convert_factor
Conversion factor for converting values for model time in model's unit type to equivalent in seconds.
Definition Bmi_Adapter.hpp:235
+
std::shared_ptr< std::vector< std::string > > input_var_names
Pointer to collection of input variable names for backing model, used by GetInputVarNames().
Definition Bmi_Adapter.hpp:244
+
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:242
+
bool isInitialized()
Get whether this instance has been initialized properly.
Definition Bmi_Adapter.hpp:213
+
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:231
+
bool bmi_model_uses_forcing_file
Whether this particular model implementation directly reads input data from the forcing file.
Definition Bmi_Adapter.hpp:239
+
void Initialize(std::string config_file) override
Initialize the wrapped BMI model object using the given config file and the object's Initialize funct...
Definition Bmi_Adapter.hpp:185
+
double get_time_convert_factor()
Determine backing model's time units and return an appropriate conversion factor.
Definition Bmi_Adapter.hpp:61
Bmi_Adapter(Bmi_Adapter &&)=default
-
utils::StreamHandler output
Definition Bmi_Adapter.hpp:241
-
double convert_model_time_to_seconds(const double &model_time_val)
Convert model time value to value in seconds.
Definition Bmi_Adapter.hpp:70
-
double convert_seconds_to_model_time(const double &seconds_val)
Convert a given number of seconds to equivalent in model time units.
Definition Bmi_Adapter.hpp:80
+
utils::StreamHandler output
Definition Bmi_Adapter.hpp:248
+
double convert_model_time_to_seconds(const double &model_time_val)
Convert model time value to value in seconds.
Definition Bmi_Adapter.hpp:77
+
double convert_seconds_to_model_time(const double &seconds_val)
Convert a given number of seconds to equivalent in model time units.
Definition Bmi_Adapter.hpp:87
+
virtual bool is_model_initialized()=0
Whether the backing model has been initialized yet.
virtual const std::string get_analogous_cxx_type(const std::string &external_type_name, const size_t item_size)=0
Get the name string for the C++ type analogous to the described type in the backing model.
-
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:226
-
bool allow_model_exceed_end_time
Whether model Update calls are allowed and handled in some way by the backing model.
Definition Bmi_Adapter.hpp:222
+
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:233
+
bool allow_model_exceed_end_time
Whether model Update calls are allowed and handled in some way by the backing model.
Definition Bmi_Adapter.hpp:229
virtual void construct_and_init_backing_model()=0
Construct the backing BMI model object, then call its BMI-native Initialize() function.
-
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:230
-
std::string model_name
Definition Bmi_Adapter.hpp:240
-
std::string forcing_file_path
Definition Bmi_Adapter.hpp:233
-
void Initialize()
Initialize the wrapped BMI model functionality using the value from the bmi_init_config member variab...
Definition Bmi_Adapter.hpp:126
-
std::shared_ptr< std::vector< std::string > > output_var_names
Pointer to collection of output variable names for backing model, used by GetOutputVarNames().
Definition Bmi_Adapter.hpp:243
+
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:237
+
std::string model_name
Definition Bmi_Adapter.hpp:247
+
std::string forcing_file_path
Definition Bmi_Adapter.hpp:240
+
void Initialize()
Initialize the wrapped BMI model functionality using the value from the bmi_init_config member variab...
Definition Bmi_Adapter.hpp:133
+
std::shared_ptr< std::vector< std::string > > output_var_names
Pointer to collection of output variable names for backing model, used by GetOutputVarNames().
Definition Bmi_Adapter.hpp:250
Custom exception indicating bad external model state.
Definition State_Exception.hpp:17
virtual char const * what() const noexcept
Definition State_Exception.hpp:31
static bool file_is_readable(std::string path)
Check whether the path provided points to an existing, readable file.
Definition FileChecker.h:90
@@ -302,7 +305,7 @@ diff --git a/_bmi___c___adapter_8hpp_source.html b/_bmi___c___adapter_8hpp_source.html index a8fba3a5cb..2251742865 100644 --- a/_bmi___c___adapter_8hpp_source.html +++ b/_bmi___c___adapter_8hpp_source.html @@ -450,13 +450,13 @@
const std::string & get_bmi_registration_function()
Definition AbstractCLibBmiAdapter.hpp:199
const void * get_dyn_lib_handle()
Definition AbstractCLibBmiAdapter.hpp:203
void dynamic_library_load()
Dynamically load and obtain this instance's handle to the shared library.
Definition AbstractCLibBmiAdapter.hpp:79
-
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:239
-
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:235
-
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:224
-
utils::StreamHandler output
Definition Bmi_Adapter.hpp:241
-
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:226
-
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:230
-
std::string forcing_file_path
Definition Bmi_Adapter.hpp:233
+
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:246
+
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:242
+
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:231
+
utils::StreamHandler output
Definition Bmi_Adapter.hpp:248
+
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:233
+
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:237
+
std::string forcing_file_path
Definition Bmi_Adapter.hpp:240
An adapter class to serve as a C++ interface to the essential aspects of external models written in t...
Definition Bmi_C_Adapter.hpp:23
int inner_get_output_item_count()
Internal implementation of logic used for.
Definition Bmi_C_Adapter.hpp:619
int GetInputItemCount() override
The number of input variables the model can use.
Definition Bmi_C_Adapter.cpp:161
@@ -529,7 +529,7 @@ diff --git a/_bmi___c___formulation_8hpp_source.html b/_bmi___c___formulation_8hpp_source.html index bb2bef3b1d..8cc7a80131 100644 --- a/_bmi___c___formulation_8hpp_source.html +++ b/_bmi___c___formulation_8hpp_source.html @@ -111,7 +111,7 @@
11namespace realization {
12
-
13 class Bmi_C_Formulation : public Bmi_Module_Formulation<models::bmi::Bmi_C_Adapter> {
+
14
15 public:
16
@@ -119,74 +119,62 @@
18
19 std::string get_formulation_type() override;
20
-
29 std::string get_output_header_line(std::string delimiter) override;
-
30
-
53 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
-
54
-
89 double get_response(time_step_t t_index, time_step_t t_delta) override;
-
90
-
91 bool is_bmi_input_variable(const std::string &var_name) override;
-
92
-
93 bool is_bmi_output_variable(const std::string &var_name) override;
-
94
-
95 protected:
-
96
-
107 std::shared_ptr<models::bmi::Bmi_C_Adapter> construct_model(const geojson::PropertyMap& properties) override;
-
108
-
-
109 time_t convert_model_time(const double &model_time) override {
-
110 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
-
111 }
+
55 double get_response(time_step_t t_index, time_step_t t_delta) override;
+
56
+
57 bool is_bmi_input_variable(const std::string &var_name) override;
+
58
+
59 bool is_bmi_output_variable(const std::string &var_name) override;
+
60
+
61 protected:
+
62
+
73 std::shared_ptr<models::bmi::Bmi_Adapter> construct_model(const geojson::PropertyMap& properties) override;
+
74
+
+
75 time_t convert_model_time(const double &model_time) override {
+
76 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
+
77 }
-
112
-
135 template<class T, class O>
-
-
136 T get_var_value_as(time_step_t t_index, const std::string& var_name) {
-
137 std::vector<O> outputs = models::bmi::GetValue<O>(*get_bmi_model(), var_name);
-
138 return (T) outputs[t_index];
-
139 }
+
78
+
101 template<class T, class O>
+
+
102 T get_var_value_as(time_step_t t_index, const std::string& var_name) {
+
103 std::vector<O> outputs = models::bmi::GetValue<O>(*get_bmi_model(), var_name);
+
104 return (T) outputs[t_index];
+
105 }
-
140
-
151 double get_var_value_as_double(const std::string& var_name) override;
+
106
+
117 double get_var_value_as_double(const std::string& var_name) override;
+
118
+
137 double get_var_value_as_double(const int& index, const std::string& var_name) override;
+
138
+
149 bool is_model_initialized() override;
+
150
+
152
-
171 double get_var_value_as_double(const int& index, const std::string& var_name) override;
-
172
-
183 bool is_model_initialized() override;
-
184
- -
186
-
187 // Unit test access
-
188 friend class ::Bmi_Formulation_Test;
-
189 friend class ::Bmi_C_Formulation_Test;
-
190 friend class ::Bmi_C_Pet_IT;
-
191
-
192 private:
-
193
- -
214
-
215 };
+
153 // Unit test access
+
154 friend class ::Bmi_Formulation_Test;
+
155 friend class ::Bmi_C_Formulation_Test;
+
156 friend class ::Bmi_C_Pet_IT;
+
157 };
-
216
-
217}
+
158
+
159}
-
218
-
219#endif //NGEN_BMI_C_FORMULATION_H
+
160
+
161#endif //NGEN_BMI_C_FORMULATION_H
Definition Bmi_C_Formulation.hpp:13
-
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_C_Formulation.cpp:140
-
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_C_Formulation.cpp:185
-
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_C_Formulation.hpp:109
-
std::string get_output_header_line(std::string delimiter) override
Get a header line appropriate for a file made up of entries from this type's implementation of get_ou...
Definition Bmi_C_Formulation.cpp:38
-
T get_var_value_as(time_step_t t_index, const std::string &var_name)
Get a value, converted to specified type, for an output variable at a time step.
Definition Bmi_C_Formulation.hpp:136
-
std::shared_ptr< models::bmi::Bmi_C_Adapter > construct_model(const geojson::PropertyMap &properties) override
Construct model and its shared pointer, potentially supplying input variable values from config.
Definition Bmi_C_Formulation.cpp:18
-
std::string get_output_line_for_timestep(int timestep, std::string delimiter) override
Get a delimited string with all the output variable values for the given time step.
Definition Bmi_C_Formulation.cpp:42
-
double get_response(time_step_t t_index, time_step_t t_delta) override
Get the model response for a time step.
Definition Bmi_C_Formulation.cpp:99
+
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_C_Formulation.cpp:111
+
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_C_Formulation.cpp:158
+
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_C_Formulation.hpp:75
+
std::shared_ptr< models::bmi::Bmi_Adapter > construct_model(const geojson::PropertyMap &properties) override
Construct model and its shared pointer, potentially supplying input variable values from config.
Definition Bmi_C_Formulation.cpp:18
+
T get_var_value_as(time_step_t t_index, const std::string &var_name)
Get a value, converted to specified type, for an output variable at a time step.
Definition Bmi_C_Formulation.hpp:102
+
double get_response(time_step_t t_index, time_step_t t_delta) override
Get the model response for a time step.
Definition Bmi_C_Formulation.cpp:70
std::string get_formulation_type() override
Definition Bmi_C_Formulation.cpp:8
-
int next_time_step_index
Index value (0-based) of the time step that will be processed by the next update of the model.
Definition Bmi_C_Formulation.hpp:213
-
bool is_model_initialized() override
Test whether backing model has run BMI Initialize.
Definition Bmi_C_Formulation.cpp:195
-
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_C_Formulation.cpp:190
-
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:34
-
std::shared_ptr< models::bmi::Bmi_C_Adapter > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.hpp:454
-
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:24
+
bool is_model_initialized() override
Test whether backing model has run BMI Initialize.
Definition Bmi_C_Formulation.cpp:168
+
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_C_Formulation.cpp:163
+
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:27
+
std::shared_ptr< models::bmi::Bmi_Adapter > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.cpp:247
+
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:25
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition Bmi_C_Formulation.hpp:11
@@ -196,7 +184,7 @@ diff --git a/_bmi___cpp___adapter_8hpp_source.html b/_bmi___cpp___adapter_8hpp_source.html index 07d377a0f3..361c21fac3 100644 --- a/_bmi___cpp___adapter_8hpp_source.html +++ b/_bmi___cpp___adapter_8hpp_source.html @@ -415,14 +415,14 @@
void * dynamic_load_symbol(const std::string &symbol_name, bool is_null_valid)
Load and return the address of the given symbol from the loaded dynamic model shared library.
Definition AbstractCLibBmiAdapter.hpp:164
const void * get_dyn_lib_handle()
Definition AbstractCLibBmiAdapter.hpp:203
void dynamic_library_load()
Dynamically load and obtain this instance's handle to the shared library.
Definition AbstractCLibBmiAdapter.hpp:79
-
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:239
-
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:235
-
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:224
-
utils::StreamHandler output
Definition Bmi_Adapter.hpp:241
-
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:226
-
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:230
-
std::string model_name
Definition Bmi_Adapter.hpp:240
-
std::string forcing_file_path
Definition Bmi_Adapter.hpp:233
+
bool model_initialized
Whether the backing model has been initialized yet, which is always initially false.
Definition Bmi_Adapter.hpp:246
+
std::string init_exception_msg
Message from an exception (if encountered) on the first attempt to initialize the backing model.
Definition Bmi_Adapter.hpp:242
+
std::string bmi_init_config
Path (as a string) to the BMI config file for initializing the backing model (empty if none).
Definition Bmi_Adapter.hpp:231
+
utils::StreamHandler output
Definition Bmi_Adapter.hpp:248
+
bool bmi_model_has_fixed_time_step
Whether this particular model has a time step size that cannot be changed internally or externally.
Definition Bmi_Adapter.hpp:233
+
std::shared_ptr< double > bmi_model_time_step_size
Pointer to stored time step size value of backing model, if it is fixed and has been retrieved.
Definition Bmi_Adapter.hpp:237
+
std::string model_name
Definition Bmi_Adapter.hpp:247
+
std::string forcing_file_path
Definition Bmi_Adapter.hpp:240
A thin wrapper class to provide convenience functions around raw BMI models written in C++,...
Definition Bmi_Cpp_Adapter.hpp:27
T * GetValuePtr(const std::string &name)
Definition Bmi_Cpp_Adapter.hpp:272
int GetInputItemCount() override
The number of input variables the model can use.
Definition Bmi_Cpp_Adapter.cpp:98
@@ -490,7 +490,7 @@ diff --git a/_bmi___cpp___formulation_8hpp_source.html b/_bmi___cpp___formulation_8hpp_source.html index 99ba2049db..a3e5350799 100644 --- a/_bmi___cpp___formulation_8hpp_source.html +++ b/_bmi___cpp___formulation_8hpp_source.html @@ -106,7 +106,7 @@
7namespace realization {
8
-
13 class Bmi_Cpp_Formulation : public Bmi_Module_Formulation<models::bmi::Bmi_Cpp_Adapter> {
+
14
15 public:
16
@@ -114,74 +114,62 @@
18
19 std::string get_formulation_type() override;
20
-
21 std::string get_output_header_line(std::string delimiter) override;
+
21 double get_response(time_step_t t_index, time_step_t t_delta) override;
22
-
23 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
+
23 bool is_bmi_input_variable(const std::string &var_name) override;
24
-
25 double get_response(time_step_t t_index, time_step_t t_delta) override;
+
25 bool is_bmi_output_variable(const std::string &var_name) override;
26
-
27 bool is_bmi_input_variable(const std::string &var_name) override;
+
27 protected:
28
-
29 bool is_bmi_output_variable(const std::string &var_name) override;
+
29 std::shared_ptr<models::bmi::Bmi_Adapter> construct_model(const geojson::PropertyMap& properties) override;
30
-
31 protected:
-
32
-
33 std::shared_ptr<models::bmi::Bmi_Cpp_Adapter> construct_model(const geojson::PropertyMap& properties) override;
-
34
-
-
35 time_t convert_model_time(const double &model_time) override {
-
36 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
-
37 }
+
+
31 time_t convert_model_time(const double &model_time) override {
+
32 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
+
33 }
-
38
-
39 template<class T, class O>
-
-
40 T get_var_value_as(time_step_t t_index, const std::string& var_name) {
-
41 std::vector<O> outputs = models::bmi::GetValue<O>(*get_bmi_model(), var_name);
-
42 return (T) outputs[t_index];
-
43 }
+
34
+
35 template<class T, class O>
+
+
36 T get_var_value_as(time_step_t t_index, const std::string& var_name) {
+
37 std::vector<O> outputs = models::bmi::GetValue<O>(*get_bmi_model(), var_name);
+
38 return (T) outputs[t_index];
+
39 }
+
40
+
41 double get_var_value_as_double(const std::string& var_name) override;
+
42
+
43 double get_var_value_as_double(const int& index, const std::string& var_name) override;
44
-
45 double get_var_value_as_double(const std::string& var_name) override;
+
45 bool is_model_initialized() override;
46
-
47 double get_var_value_as_double(const int& index, const std::string& var_name) override;
+
47 protected:
48
-
49 bool is_model_initialized() override;
+
50
-
51 protected:
-
52
- -
54
-
55 // Unit test access
-
56 friend class ::Bmi_Formulation_Test;
-
57 friend class ::Bmi_Cpp_Formulation_Test;
-
58
-
59 private:
-
60
- -
62
-
63 };
+
51 // Unit test access
+
52 friend class ::Bmi_Formulation_Test;
+
53 friend class ::Bmi_Cpp_Formulation_Test;
+
54 };
-
64
-
65}
-
66
-
67#endif //NGEN_BMI_CPP_FORMULATION_H
+
55
+
56}
+
57
+
58#endif //NGEN_BMI_CPP_FORMULATION_H
Encapsulates a bmi::Bmi model in C++ such that it can be loaded as a formulation, as such also so tha...
Definition Bmi_Cpp_Formulation.hpp:13
-
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_Cpp_Formulation.cpp:139
-
T get_var_value_as(time_step_t t_index, const std::string &var_name)
Definition Bmi_Cpp_Formulation.hpp:40
-
std::string get_output_line_for_timestep(int timestep, std::string delimiter) override
Get a formatted line of output values for the given time step as a delimited string.
Definition Bmi_Cpp_Formulation.cpp:52
-
double get_response(time_step_t t_index, time_step_t t_delta) override
Get the model response for a time step.
Definition Bmi_Cpp_Formulation.cpp:98
-
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Cpp_Formulation.hpp:35
-
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Cpp_Formulation.cpp:184
-
std::shared_ptr< models::bmi::Bmi_Cpp_Adapter > construct_model(const geojson::PropertyMap &properties) override
Construct model and its shared pointer.
Definition Bmi_Cpp_Formulation.cpp:21
+
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_Cpp_Formulation.cpp:121
+
T get_var_value_as(time_step_t t_index, const std::string &var_name)
Definition Bmi_Cpp_Formulation.hpp:36
+
std::shared_ptr< models::bmi::Bmi_Adapter > construct_model(const geojson::PropertyMap &properties) override
Construct model and its shared pointer.
Definition Bmi_Cpp_Formulation.cpp:21
+
double get_response(time_step_t t_index, time_step_t t_delta) override
Get the model response for a time step.
Definition Bmi_Cpp_Formulation.cpp:80
+
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Cpp_Formulation.hpp:31
+
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Cpp_Formulation.cpp:169
std::string get_formulation_type() override
Definition Bmi_Cpp_Formulation.cpp:11
-
int next_time_step_index
Definition Bmi_Cpp_Formulation.hpp:61
-
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Cpp_Formulation.cpp:189
-
std::string get_output_header_line(std::string delimiter) override
Get a header line appropriate for a file made up of entries from this type's implementation of get_ou...
Definition Bmi_Cpp_Formulation.cpp:48
-
bool is_model_initialized() override
Test whether the backing model object has been initialize using the BMI standard Initialize function.
Definition Bmi_Cpp_Formulation.cpp:194
-
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:34
-
std::shared_ptr< models::bmi::Bmi_Cpp_Adapter > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.hpp:454
-
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:24
+
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Cpp_Formulation.cpp:174
+
bool is_model_initialized() override
Test whether the backing model has been initialize using the BMI standard Initialize function.
Definition Bmi_Cpp_Formulation.cpp:179
+
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:27
+
std::shared_ptr< models::bmi::Bmi_Adapter > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.cpp:247
+
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:25
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition Bmi_C_Formulation.hpp:11
@@ -191,7 +179,7 @@ diff --git a/_bmi___formulation_8hpp_source.html b/_bmi___formulation_8hpp_source.html index 004278ae8e..f1c36bf63a 100644 --- a/_bmi___formulation_8hpp_source.html +++ b/_bmi___formulation_8hpp_source.html @@ -358,7 +358,7 @@ diff --git a/_bmi___fortran___adapter_8hpp_source.html b/_bmi___fortran___adapter_8hpp_source.html index 39eba3219c..502b316f09 100644 --- a/_bmi___fortran___adapter_8hpp_source.html +++ b/_bmi___fortran___adapter_8hpp_source.html @@ -552,7 +552,7 @@ diff --git a/_bmi___fortran___common_8h_source.html b/_bmi___fortran___common_8h_source.html index 28750d901b..97e78c36c6 100644 --- a/_bmi___fortran___common_8h_source.html +++ b/_bmi___fortran___common_8h_source.html @@ -224,7 +224,7 @@ diff --git a/_bmi___fortran___formulation_8hpp_source.html b/_bmi___fortran___formulation_8hpp_source.html index bdc35734af..a0917b7a9f 100644 --- a/_bmi___fortran___formulation_8hpp_source.html +++ b/_bmi___fortran___formulation_8hpp_source.html @@ -115,7 +115,7 @@
16
17namespace realization {
18
-
19 class Bmi_Fortran_Formulation : public Bmi_Module_Formulation<Bmi_Fortran_Adapter> {
+
19 class Bmi_Fortran_Formulation : public Bmi_Module_Formulation {
20
21 public:
22
@@ -123,38 +123,33 @@
24
25 std::string get_formulation_type() override;
26
-
49 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
-
50
-
83 double get_response(::time_step_t index, ::time_step_t t_delta) override;
+
59 double get_response(::time_step_t index, ::time_step_t t_delta) override;
+
60
+
61 protected:
+
62
+
75 std::shared_ptr<Bmi_Adapter> construct_model(const geojson::PropertyMap& properties) override;
+
76
+
77 time_t convert_model_time(const double &model_time) override {
+
78 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
+
79 }
+
80
+
81 double get_var_value_as_double(const std::string &var_name) override;
+
82
+
83 double get_var_value_as_double(const int &index, const std::string &var_name) override;
84
-
85 protected:
+
85 friend class Bmi_Multi_Formulation;
86
-
99 std::shared_ptr<Bmi_Fortran_Adapter> construct_model(const geojson::PropertyMap& properties) override;
-
100
-
101 time_t convert_model_time(const double &model_time) override {
-
102 return (time_t) (get_bmi_model()->convert_model_time_to_seconds(model_time));
-
103 }
-
104
-
105 double get_var_value_as_double(const std::string &var_name) override;
-
106
-
107 double get_var_value_as_double(const int &index, const std::string &var_name) override;
-
108
-
109 friend class Bmi_Multi_Formulation;
-
110
-
111 // Unit test access
-
112 friend class ::Bmi_Multi_Formulation_Test;
-
113 friend class ::Bmi_Formulation_Test;
-
114 friend class ::Bmi_Fortran_Formulation_Test;
-
115
-
116 private:
-
136 int next_time_step_index = 0;
-
137 };
-
138
-
139}
-
140
-
141#endif // NGEN_BMI_FORTRAN_ACTIVE
-
142
-
143#endif //NGEN_BMI_FORTRAN_FORMULATION_HPP
+
87 // Unit test access
+
88 friend class ::Bmi_Multi_Formulation_Test;
+
89 friend class ::Bmi_Formulation_Test;
+
90 friend class ::Bmi_Fortran_Formulation_Test;
+
91 };
+
92
+
93}
+
94
+
95#endif // NGEN_BMI_FORTRAN_ACTIVE
+
96
+
97#endif //NGEN_BMI_FORTRAN_FORMULATION_HPP
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition AbstractCLibBmiAdapter.hpp:10
@@ -165,7 +160,7 @@ diff --git a/_bmi___module___formulation_8hpp_source.html b/_bmi___module___formulation_8hpp_source.html index ed37c59e4c..7c34637872 100644 --- a/_bmi___module___formulation_8hpp_source.html +++ b/_bmi___module___formulation_8hpp_source.html @@ -103,972 +103,308 @@
4#include <utility>
5#include <memory>
6#include "Bmi_Formulation.hpp"
-
7#include "WrappedDataProvider.hpp"
-
8#include "Bmi_C_Adapter.hpp"
-
9#include <AorcForcing.hpp>
-
10#include <DataProvider.hpp>
-
11#include <UnitsHelper.hpp>
-
12#include "bmi_utilities.hpp"
-
13#include "utilities/logging_utils.h"
-
14
- - -
17
-
18// Forward declaration to provide access to protected items in testing
-
19class Bmi_Formulation_Test;
-
20class Bmi_Multi_Formulation_Test;
-
21class Bmi_C_Formulation_Test;
-
22class Bmi_Cpp_Formulation_Test;
-
23class Bmi_C_Pet_IT;
-
24class Bmi_Cpp_Multi_Array_Test;
-
25
-
26namespace realization {
-
27
-
33 template <class M>
-
- -
35
-
36 public:
-
37
-
-
46 Bmi_Module_Formulation(std::string id, std::shared_ptr<data_access::GenericDataProvider> forcing_provider, utils::StreamHandler output_stream)
-
47 : Bmi_Formulation(std::move(id), forcing_provider, output_stream) { };
-
-
48
- -
50
-
-
51 void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global = nullptr) override {
-
52 geojson::PropertyMap options = this->interpret_parameters(config, global);
-
53 inner_create_formulation(options, false);
-
54 }
-
-
55
-
-
56 void create_formulation(geojson::PropertyMap properties) override {
-
57 inner_create_formulation(properties, true);
-
58 }
-
-
59
-
-
73 boost::span<const std::string> get_available_variable_names() override {
- -
75 for (const std::string &output_var_name : get_bmi_model()->GetOutputVarNames()) {
-
76 available_forcings.push_back(output_var_name);
-
77 if (bmi_var_names_map.find(output_var_name) != bmi_var_names_map.end())
-
78 available_forcings.push_back(bmi_var_names_map[output_var_name]);
-
79 }
-
80 }
-
81 return available_forcings;
-
82 }
-
-
83
-
-
93 time_t get_variable_time_begin(const std::string &variable_name) {
-
94 // TODO: come back and implement if actually necessary for this type; for now don't use
-
95 throw std::runtime_error("Bmi_Modular_Formulation does not yet implement get_variable_time_begin");
-
96 }
-
-
97
-
-
107 long get_data_start_time() override
-
108 {
-
109 return this->get_bmi_model()->GetStartTime();
-
110 }
-
+
7#include "Bmi_Adapter.hpp"
+
8#include <DataProvider.hpp>
+
9#include "bmi_utilities.hpp"
+
10
+ + +
13
+
14// Forward declaration to provide access to protected items in testing
+
15class Bmi_Formulation_Test;
+
16class Bmi_Multi_Formulation_Test;
+
17class Bmi_C_Formulation_Test;
+
18class Bmi_Cpp_Formulation_Test;
+
19class Bmi_C_Pet_IT;
+
20class Bmi_Cpp_Multi_Array_Test;
+
21
+
22namespace realization {
+
23
+
+ +
28
+
29 public:
+
30
+
+
39 Bmi_Module_Formulation(std::string id, std::shared_ptr<data_access::GenericDataProvider> forcing_provider, utils::StreamHandler output_stream)
+
40 : Bmi_Formulation(std::move(id), forcing_provider, output_stream) { }
+
+
41
+
42 ~Bmi_Module_Formulation() override = default;
+
43
+
44 void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global = nullptr) override;
+
45 void create_formulation(geojson::PropertyMap properties) override;
+
46
+
60 boost::span<const std::string> get_available_variable_names() override;
+
61
+
84 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
+
85
+
95 time_t get_variable_time_begin(const std::string &variable_name);
+
96
+
106 long get_data_start_time() override;
+
107
+
108 long get_data_stop_time() override;
+
109
+
110 long record_duration() override;
111
-
121 //time_t get_forcing_output_time_end(const std::string &output_name) {
-
-
122 time_t get_variable_time_end(const std::string &varibale_name) {
-
123 // TODO: come back and implement if actually necessary for this type; for now don't use
-
124 throw std::runtime_error("Bmi_Module_Formulation does not yet implement get_variable_time_end");
-
125 }
-
-
126
-
-
127 long get_data_stop_time() override {
-
128 // TODO: come back and implement if actually necessary for this type; for now don't use
-
129 throw std::runtime_error("Bmi_Module_Formulation does not yet implement get_data_stop_time");
-
130 }
-
-
131
-
-
132 long record_duration() override {
-
133 throw std::runtime_error("Bmi_Module_Formulation does not yet implement record_duration");
-
134 }
-
-
135
-
-
141 const double get_model_current_time() override {
-
142 return get_bmi_model()->GetCurrentTime();
-
143 }
-
-
144
-
-
150 const double get_model_end_time() override {
-
151 return get_bmi_model()->GetEndTime();
-
152 }
-
-
153
-
-
154 const std::vector<std::string> &get_required_parameters() override {
-
155 return REQUIRED_PARAMETERS;
-
156 }
-
-
157
-
-
172 const std::string &get_config_mapped_variable_name(const std::string &model_var_name) override {
-
173 // TODO: need to introduce validation elsewhere that all mapped names are valid AORC field constants.
-
174 if (bmi_var_names_map.find(model_var_name) != bmi_var_names_map.end())
-
175 return bmi_var_names_map[model_var_name];
-
176 else
-
177 return model_var_name;
-
178 }
-
-
179
-
-
193 size_t get_ts_index_for_time(const time_t &epoch_time) override {
-
194 // TODO: come back and implement if actually necessary for this type; for now don't use
-
195 throw std::runtime_error("Bmi_Singular_Formulation does not yet implement get_ts_index_for_time");
-
196 }
-
-
197
-
-
209 std::vector<double> get_values(const CatchmentAggrDataSelector& selector, data_access::ReSampleMethod m=SUM) override
-
210 {
-
211 std::string output_name = selector.get_variable_name();
-
212 time_t init_time = selector.get_init_time();
-
213 long duration_s = selector.get_duration_secs();
-
214 std::string output_units = selector.get_output_units();
-
215
-
216 // First make sure this is an available output
-
217 auto forcing_outputs = get_available_variable_names();
-
218 if (std::find(forcing_outputs.begin(), forcing_outputs.end(), output_name) == forcing_outputs.end()) {
-
219 throw std::runtime_error(get_formulation_type() + " received invalid output forcing name " + output_name);
-
220 }
-
221 // TODO: do this, or something better, later; right now, just assume anything using this as a provider is
-
222 // consistent with times
-
223 /*
-
224 if (last_model_response_delta == 0 && last_model_response_start_time == 0) {
-
225 throw runtime_error(get_formulation_type() + " does not properly set output time validity ranges "
-
226 "needed to provide outputs as forcings");
-
227 }
-
228 */
-
229
-
230 // check if output is available from BMI
-
231 std::string bmi_var_name;
-
232 get_bmi_output_var_name(output_name, bmi_var_name);
-
233
-
234 if( !bmi_var_name.empty() )
-
235 {
-
236 auto model = get_bmi_model().get();
-
237 //Get vector of double values for variable
-
238 //The return type of the vector here dependent on what
-
239 //needs to use it. For other BMI moudles, that is runtime dependent
-
240 //on the type of the requesting module
-
241 auto values = models::bmi::GetValue<double>(*model, bmi_var_name);
-
242
-
243 // Convert units
-
244 std::string native_units = get_bmi_model()->GetVarUnits(bmi_var_name);
-
245 try {
-
246 UnitsHelper::convert_values(native_units, values.data(), output_units, values.data(), values.size());
-
247 return values;
-
248 }
-
249 catch (const std::runtime_error& e){
-
250 #ifndef UDUNITS_QUIET
-
251 logging::warning((std::string("WARN: Unit conversion unsuccessful - Returning unconverted value! (\"")+e.what()+"\")\n").c_str());
-
252 #endif
-
253 return values;
-
254 }
-
255 }
-
256 //This is unlikely (impossible?) to throw since a pre-check on available names is done above. Assert instead?
-
257 throw std::runtime_error(get_formulation_type() + " received invalid output forcing name " + output_name);
-
258 }
-
-
259
-
- -
278 {
-
279 std::string output_name = selector.get_variable_name();
-
280 time_t init_time = selector.get_init_time();
-
281 long duration_s = selector.get_duration_secs();
-
282 std::string output_units = selector.get_output_units();
-
283
-
284 // First make sure this is an available output
-
285 auto forcing_outputs = get_available_variable_names();
-
286 if (std::find(forcing_outputs.begin(), forcing_outputs.end(), output_name) == forcing_outputs.end()) {
-
287 throw std::runtime_error(get_formulation_type() + " received invalid output forcing name " + output_name);
-
288 }
-
289 // TODO: do this, or something better, later; right now, just assume anything using this as a provider is
-
290 // consistent with times
-
291 /*
-
292 if (last_model_response_delta == 0 && last_model_response_start_time == 0) {
-
293 throw runtime_error(get_formulation_type() + " does not properly set output time validity ranges "
-
294 "needed to provide outputs as forcings");
-
295 }
-
296 */
-
297
-
298 // check if output is available from BMI
-
299 std::string bmi_var_name;
-
300 get_bmi_output_var_name(output_name, bmi_var_name);
-
301
-
302 if( !bmi_var_name.empty() )
-
303 {
-
304 //Get forcing value from BMI variable
-
305 double value = get_var_value_as_double(bmi_var_name);
-
306
-
307 // Convert units
-
308 std::string native_units = get_bmi_model()->GetVarUnits(bmi_var_name);
-
309 try {
-
310 return UnitsHelper::get_converted_value(native_units, value, output_units);
-
311 }
-
312 catch (const std::runtime_error& e){
-
313 #ifndef UDUNITS_QUIET
-
314 std::cerr<<"WARN: Unit conversion unsuccessful - Returning unconverted value! (\""<<e.what()<<"\")"<<std::endl;
-
315 #endif
-
316 return value;
-
317 }
-
318 }
-
319
-
320 //This is unlikely (impossible?) to throw since a pre-check on available names is done above. Assert instead?
-
321 throw std::runtime_error(get_formulation_type() + " received invalid output forcing name " + output_name);
-
322 }
-
-
323
-
-
324 bool is_bmi_input_variable(const std::string &var_name) override {
- -
326 }
-
+
117 const double get_model_current_time() override;
+
118
+
124 const double get_model_end_time() override;
+
125
+
126 const std::vector<std::string> &get_required_parameters() override;
+
127
+
142 const std::string &get_config_mapped_variable_name(const std::string &model_var_name) override;
+
143
+
157 size_t get_ts_index_for_time(const time_t &epoch_time) override;
+
158
+
170 std::vector<double> get_values(const CatchmentAggrDataSelector& selector, data_access::ReSampleMethod m=SUM) override;
+
171
+
189 double get_value(const CatchmentAggrDataSelector& selector, data_access::ReSampleMethod m) override;
+
190
+
191 bool is_bmi_input_variable(const std::string &var_name) override;
+
192 bool is_bmi_output_variable(const std::string &var_name) override;
+
193
+
212 bool is_property_sum_over_time_step(const std::string& name) override;
+
213
+
214 const std::vector<std::string> get_bmi_input_variables() override;
+
215 const std::vector<std::string> get_bmi_output_variables() override;
+
216
+
217 protected:
+
218
+
225 void get_bmi_output_var_name(const std::string &name, std::string &bmi_var_name);
+
226
+
237 virtual std::shared_ptr<models::bmi::Bmi_Adapter> construct_model(const geojson::PropertyMap& properties) = 0;
+
238
+ +
248
+
264 const bool &get_allow_model_exceed_end_time() const override;
+
265
+
266 const std::string &get_bmi_init_config() const;
+
267
+
273 std::shared_ptr<models::bmi::Bmi_Adapter> get_bmi_model();
+
274
+
275 const std::string &get_forcing_file_path() const override;
+
276
+
277 const time_t &get_bmi_model_start_time_forcing_offset_s() override;
+
278
+
290 void inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation);
+
291
+ +
304
+
310 bool is_bmi_model_time_step_fixed() override;
+
311
+
317 bool is_bmi_using_forcing_file() const override;
+
318
+
324 bool is_model_initialized() override;
+
325
+
326 void set_allow_model_exceed_end_time(bool allow_exceed_end);
327
-
-
328 bool is_bmi_output_variable(const std::string &var_name) override {
- -
330 }
-
-
331
-
-
332 inline bool is_var_name_in_collection(const std::vector<std::string> &all_names, const std::string &var_name) {
-
333 return std::count(all_names.begin(), all_names.end(), var_name) > 0;
-
334 }
-
-
335
-
-
354 bool is_property_sum_over_time_step(const std::string& name) override {
-
355 // TODO: verify with some kind of proof that "always true" is appropriate
-
356 return true;
-
357 }
-
-
358
-
-
359 const std::vector<std::string> get_bmi_input_variables() override {
-
360 return get_bmi_model()->GetInputVarNames();
-
361 }
-
-
362
-
-
363 const std::vector<std::string> get_bmi_output_variables() override {
-
364 return get_bmi_model()->GetOutputVarNames();
-
365 }
-
-
366
-
367 protected:
-
368
-
-
375 inline void get_bmi_output_var_name(const std::string &name, std::string &bmi_var_name)
-
376 {
-
377 //check standard output names first
-
378 std::vector<std::string> output_names = get_bmi_model()->GetOutputVarNames();
-
379 if (std::find(output_names.begin(), output_names.end(), name) != output_names.end()) {
-
380 bmi_var_name = name;
-
381 }
-
382 else
-
383 {
-
384 //check mapped names
-
385 std::string mapped_name;
-
386 for (auto & iter : bmi_var_names_map) {
-
387 if (iter.second == name) {
-
388 mapped_name = iter.first;
-
389 break;
-
390 }
-
391 }
-
392 //ensure mapped name maps to an output variable, see GH #393 =)
-
393 if (std::find(output_names.begin(), output_names.end(), mapped_name) != output_names.end()){
-
394 bmi_var_name = mapped_name;
-
395 }
-
396 //else not an output variable
-
397 }
-
398 }
-
-
399
-
410 virtual std::shared_ptr<M> construct_model(const geojson::PropertyMap& properties) = 0;
-
411
-
- - -
422 // TODO: Look at making this epoch start configurable instead of from forcing
-
423 forcing->get_data_start_time() - convert_model_time(get_bmi_model()->GetStartTime()));
-
424 }
-
-
425
-
-
441 const bool &get_allow_model_exceed_end_time() const override {
- -
443 }
-
-
444
-
-
445 const std::string &get_bmi_init_config() const {
-
446 return bmi_init_config;
-
447 }
-
-
448
-
-
454 std::shared_ptr<M> get_bmi_model() {
-
455 return bmi_model;
-
456 }
-
-
457
-
-
458 const std::string &get_forcing_file_path() const override {
-
459 return forcing_file_path;
-
460 }
-
-
461
-
- - -
464 }
-
-
-
476 void inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation) {
-
477 if (needs_param_validation) {
-
478 validate_parameters(properties);
-
479 }
-
480 // Required parameters first
-
481 set_bmi_init_config(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG).as_string());
-
482 set_bmi_main_output_var(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR).as_string());
-
483 set_model_type_name(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE).as_string());
-
484 set_bmi_using_forcing_file(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__USES_FORCINGS).as_boolean());
-
485
-
486 // Then optional ...
-
487
-
488 // Note that this must be present if bmi_using_forcing_file is true
-
489 if (properties.find(BMI_REALIZATION_CFG_PARAM_OPT__FORCING_FILE) != properties.end())
-
490 set_forcing_file_path(properties.at(BMI_REALIZATION_CFG_PARAM_OPT__FORCING_FILE).as_string());
-
491 else if (is_bmi_using_forcing_file())
-
492 throw std::runtime_error("Can't create BMI formulation: using_forcing_file true but no file path set");
-
493
-
494 if (properties.find(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END) != properties.end()) {
- -
496 properties.at(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END).as_boolean());
-
497 }
-
498 if (properties.find(BMI_REALIZATION_CFG_PARAM_OPT__FIXED_TIME_STEP) != properties.end()) {
- -
500 properties.at(BMI_REALIZATION_CFG_PARAM_OPT__FIXED_TIME_STEP).as_boolean());
-
501 }
-
502
-
503 auto std_names_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__VAR_STD_NAMES);
-
504 if (std_names_it != properties.end()) {
-
505 geojson::PropertyMap names_map = std_names_it->second.get_values();
-
506 for (auto& names_it : names_map) {
-
507 bmi_var_names_map.insert(
-
508 std::pair<std::string, std::string>(names_it.first, names_it.second.as_string()));
-
509 }
-
510 }
-
511
-
512 // Do this next, since after checking whether other input variables are present in the properties, we can
-
513 // now construct the adapter and init the model
-
514 set_bmi_model(construct_model(properties));
-
515
-
516 //Check if any parameter values need to be set on the BMI model,
-
517 //and set them before it is run
-
518 set_initial_bmi_parameters(properties);
-
519
-
520 // Make sure that this is able to interpret model time and convert to real time, since BMI model time is
-
521 // usually starting at 0 and just counting up
- -
523
-
524 // Output variable subset and order, if present
-
525 auto out_var_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS);
-
526 if (out_var_it != properties.end()) {
-
527 std::vector<geojson::JSONProperty> out_vars_json_list = out_var_it->second.as_list();
-
528 std::vector<std::string> out_vars(out_vars_json_list.size());
-
529 for (int i = 0; i < out_vars_json_list.size(); ++i) {
-
530 out_vars[i] = out_vars_json_list[i].as_string();
-
531 }
- -
533 }
-
534 // Otherwise, just take what literally is provided by the model
-
535 else {
-
536 set_output_variable_names(get_bmi_model()->GetOutputVarNames());
-
537 }
-
538
-
539 // Output header fields, if present
-
540 auto out_headers_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS);
-
541 if (out_headers_it != properties.end()) {
-
542 std::vector<geojson::JSONProperty> out_headers_json_list = out_var_it->second.as_list();
-
543 std::vector<std::string> out_headers(out_headers_json_list.size());
-
544 for (int i = 0; i < out_headers_json_list.size(); ++i) {
-
545 out_headers[i] = out_headers_json_list[i].as_string();
-
546 }
-
547 set_output_header_fields(out_headers);
-
548 }
-
549 else {
- -
551 }
-
552
-
553 // Output precision, if present
-
554 auto out_precision_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUTPUT_PRECISION);
-
555 if (out_precision_it != properties.end()) {
-
556 set_output_precision(properties.at(BMI_REALIZATION_CFG_PARAM_OPT__OUTPUT_PRECISION).as_natural_number());
-
557 }
-
558
-
559 // Finally, make sure this is set
-
560 model_initialized = get_bmi_model()->is_model_initialized();
-
561 }
-
-
562
-
- -
575 auto model = get_bmi_model();
-
576 if( model == nullptr ) return;
-
577 //Now that the model is ready, we can set some intial parameters passed in the config
-
578 auto model_params = properties.find("model_params");
-
579
-
580 if (model_params != properties.end() ){
-
581
-
582 geojson::PropertyMap params = model_params->second.get_values();
-
583 //Declare/init the possible vectors here
-
584 //reuse them for each loop iteration, make sure to clear them
-
585 std::vector<long> long_vec;
-
586 std::vector<double> double_vec;
-
587 //not_supported
-
588 //std::vector<std::string> str_vec;
-
589 //std::vector<bool> bool_vec;
-
590 std::shared_ptr<void> value_ptr;
-
591 for (auto& param : params) {
-
592 //Get some basic BMI info for this param
-
593 int varItemSize = get_bmi_model()->GetVarItemsize(param.first);
-
594 int totalBytes = get_bmi_model()->GetVarNbytes(param.first);
-
595
-
596 //Figure out the c++ type to convert data to
-
597 std::string type = get_bmi_model()->get_analogous_cxx_type(get_bmi_model()->GetVarType(param.first),
-
598 varItemSize);
-
599 //TODO might consider refactoring as_vector and get_values_as_type
-
600 //(and by extension, as_c_array) into the JSONProperty class
-
601 //then instead of the PropertyVariant visitor filling vectors
-
602 //it could fill the c-like array and avoid another copy.
-
603 switch( param.second.get_type() ){
- -
605 param.second.as_vector(long_vec);
-
606 value_ptr = get_values_as_type(type, long_vec.begin(), long_vec.end());
-
607 break;
- -
609 param.second.as_vector(double_vec);
-
610 value_ptr = get_values_as_type(type, double_vec.begin(), double_vec.end());
-
611 break;
-
612 /* Not currently supporting string parameter values
-
613 case geojson::PropertyType::String:
-
614 param.second.as_vector(str_vec);
-
615 value_ptr = get_values_as_type(type, long_vec.begin(), long_vec.end());
-
616 */
-
617 /* Not currently supporting native bool (true/false) parameter values (use int 0/1)
-
618 case geojson::PropertyType::Boolean:
-
619 param.second.as_vector(bool_vec);
-
620 //data_ptr = bool_vec.data();
-
621 */
- -
623 //In this case, only supporting numeric lists
-
624 //will retrieve as double (longs will get casted)
-
625 //TODO consider some additional introspection/optimization for this?
-
626 param.second.as_vector(double_vec);
-
627 if(double_vec.size() == 0){
-
628 logging::warning(("Cannot pass non-numeric lists as a BMI parameter, skipping "+param.first+"\n").c_str());
-
629 continue;
-
630 }
-
631 value_ptr = get_values_as_type(type, double_vec.begin(), double_vec.end());
-
632 break;
-
633 default:
-
634 logging::warning(("Cannot pass parameter of type "+geojson::get_propertytype_name(param.second.get_type())+" as a BMI parameter, skipping "+param.first+"\n").c_str());
-
635 continue;
-
636 }
-
637 try{
-
638
-
639 // Finally, use the value obtained to set the model param
-
640 get_bmi_model()->SetValue(param.first, value_ptr.get());
-
641 }
-
642 catch (const std::exception &e)
-
643 {
-
644 logging::warning((std::string("Exception setting parameter value: ")+e.what()).c_str());
-
645 logging::warning(("Skipping parameter: "+param.first+"\n").c_str());
-
646 }
-
647 catch (...)
-
648 {
-
649 logging::warning((std::string("Unknown Exception setting parameter value: \n")).c_str());
-
650 logging::warning(("Skipping parameter: "+param.first+"\n").c_str());
-
651 }
-
652 long_vec.clear();
-
653 double_vec.clear();
-
654 //Not supported
-
655 //str_vec.clear();
-
656 //bool_vec.clear();
-
657 }
-
658
-
659 }
-
660 //TODO use SetValue(name, vector<t>) overloads???
-
661 //implment the overloads in each adapter
-
662 //ensure proper type is prepared before setting value
-
663 }
-
-
664
-
- - -
672 }
-
-
673
-
-
679 bool is_bmi_using_forcing_file() const override {
- -
681 }
-
-
682
-
-
688 bool is_model_initialized() override {
-
689 return model_initialized;
-
690 };
-
-
691
-
-
692 void set_allow_model_exceed_end_time(bool allow_exceed_end) {
-
693 allow_model_exceed_end_time = allow_exceed_end;
-
694 }
-
-
695
-
-
696 void set_bmi_init_config(const std::string &init_config) {
-
697 bmi_init_config = init_config;
-
698 }
-
-
699
-
-
705 void set_bmi_model(std::shared_ptr<M> model) {
-
706 bmi_model = model;
-
707 }
-
-
708
-
-
709 void set_bmi_model_start_time_forcing_offset_s(const time_t &offset_s) {
- -
711 }
-
-
712
-
-
713 void set_bmi_model_time_step_fixed(bool is_fix_time_step) {
-
714 bmi_model_time_step_fixed = is_fix_time_step;
-
715 }
-
-
716
-
-
722 void set_bmi_using_forcing_file(bool uses_forcing_file) {
-
723 bmi_using_forcing_file = uses_forcing_file;
-
724 }
-
-
725
-
-
726 void set_forcing_file_path(const std::string &forcing_path) {
-
727 forcing_file_path = forcing_path;
-
728 }
-
-
729
-
-
735 virtual void set_model_initialized(bool is_initialized) {
-
736 model_initialized = is_initialized;
-
737 }
-
-
738
-
752 template <typename T, typename Iterator>
-
-
753 std::shared_ptr<T> as_c_array(Iterator begin, Iterator end){
-
754 //Make a shared pointer large enough to hold all elements
-
755 //This is a CONTIGUOUS array of type T
-
756 //Must provide a custom deleter to delete the array
-
757 std::shared_ptr<T> ptr( new T[std::distance(begin, end)], [](T *p) { delete[] p; } );
-
758 Iterator it = begin;
-
759 int i = 0;
-
760 while(it != end){
-
761 //Be safe and cast the input to the desired type
-
762 ptr.get()[i] = static_cast<T>(*it);
-
763 ++it;
-
764 ++i;
-
765 }
-
766 return ptr;
-
767 }
-
-
768
-
778 template <typename Iterator>
-
-
779 std::shared_ptr<void> get_values_as_type(std::string type, Iterator begin, Iterator end)
-
780 {
-
781 //Use std::vector range constructor to ensure contiguous storage of values
-
782 //Return the pointer to the contiguous storage
-
783 if (type == "double" || type == "double precision")
-
784 return as_c_array<double>(begin, end);
-
785
-
786 if (type == "float" || type == "real")
-
787 return as_c_array<float>(begin, end);
-
788
-
789 if (type == "short" || type == "short int" || type == "signed short" || type == "signed short int")
-
790 return as_c_array<short>(begin, end);
-
791
-
792 if (type == "unsigned short" || type == "unsigned short int")
-
793 return as_c_array<unsigned short>(begin, end);
-
794
-
795 if (type == "int" || type == "signed" || type == "signed int" || type == "integer")
-
796 return as_c_array<int>(begin, end);
-
797
-
798 if (type == "unsigned" || type == "unsigned int")
-
799 return as_c_array<unsigned int>(begin, end);
-
800
-
801 if (type == "long" || type == "long int" || type == "signed long" || type == "signed long int")
-
802 return as_c_array<long>(begin, end);
-
803
-
804 if (type == "unsigned long" || type == "unsigned long int")
-
805 return as_c_array<unsigned long>(begin, end);
-
806
-
807 if (type == "long long" || type == "long long int" || type == "signed long long" || type == "signed long long int")
-
808 return as_c_array<long long>(begin, end);
-
809
-
810 if (type == "unsigned long long" || type == "unsigned long long int")
-
811 return as_c_array<unsigned long long>(begin, end);
-
812
-
813 throw std::runtime_error("Unable to get values of iterable as type" + type + " from " + get_model_type_name() +
-
814 " : no logic for converting values to variable's type.");
-
815 }
-
-
816
-
817 // TODO: need to modify this to support arrays properly, since in general that's what BMI modules deal with
-
818 template<typename T>
-
-
819 std::shared_ptr<void> get_value_as_type(std::string type, T value)
-
820 {
-
821 if (type == "double" || type == "double precision")
-
822 return std::make_shared<double>( static_cast<double>(value) );
-
823
-
824 if (type == "float" || type == "real")
-
825 return std::make_shared<float>( static_cast<float>(value) );
-
826
-
827 if (type == "short" || type == "short int" || type == "signed short" || type == "signed short int")
-
828 return std::make_shared<short>( static_cast<short>(value) );
-
829
-
830 if (type == "unsigned short" || type == "unsigned short int")
-
831 return std::make_shared<unsigned short>( static_cast<unsigned short>(value) );
-
832
-
833 if (type == "int" || type == "signed" || type == "signed int" || type == "integer")
-
834 return std::make_shared<int>( static_cast<int>(value) );
-
835
-
836 if (type == "unsigned" || type == "unsigned int")
-
837 return std::make_shared<unsigned int>( static_cast<unsigned int>(value) );
-
838
-
839 if (type == "long" || type == "long int" || type == "signed long" || type == "signed long int")
-
840 return std::make_shared<long>( static_cast<long>(value) );
-
841
-
842 if (type == "unsigned long" || type == "unsigned long int")
-
843 return std::make_shared<unsigned long>( static_cast<unsigned long>(value) );
-
844
-
845 if (type == "long long" || type == "long long int" || type == "signed long long" || type == "signed long long int")
-
846 return std::make_shared<long long>( static_cast<long long>(value) );
-
847
-
848 if (type == "unsigned long long" || type == "unsigned long long int")
-
849 return std::make_shared<unsigned long long>( static_cast<unsigned long long>(value) );
-
850
-
851 throw std::runtime_error("Unable to get value of variable as type" + type + " from " + get_model_type_name() +
-
852 " : no logic for converting value to variable's type.");
-
853 }
-
-
854
-
-
862 void set_model_inputs_prior_to_update(const double &model_init_time, time_step_t t_delta) {
-
863 std::vector<std::string> in_var_names = get_bmi_model()->GetInputVarNames();
-
864 time_t model_epoch_time = convert_model_time(model_init_time) + get_bmi_model_start_time_forcing_offset_s();
-
865
-
866 for (std::string & var_name : in_var_names) {
- -
868 std::string var_map_alias = get_config_mapped_variable_name(var_name);
-
869 if (input_forcing_providers.find(var_map_alias) != input_forcing_providers.end()) {
-
870 provider = input_forcing_providers[var_map_alias].get();
-
871 }
-
872 else if (var_map_alias != var_name && input_forcing_providers.find(var_name) != input_forcing_providers.end()) {
-
873 provider = input_forcing_providers[var_name].get();
-
874 }
-
875 else {
-
876 provider = forcing.get();
-
877 }
-
878
-
879 // TODO: probably need to actually allow this by default and warn, but have config option to activate
-
880 // this type of behavior
-
881 // TODO: account for arrays later
-
882 int nbytes = get_bmi_model()->GetVarNbytes(var_name);
-
883 int varItemSize = get_bmi_model()->GetVarItemsize(var_name);
-
884 int numItems = nbytes / varItemSize;
-
885 assert(nbytes % varItemSize == 0);
-
886
-
887 std::shared_ptr<void> value_ptr;
-
888 // Finally, use the value obtained to set the model input
-
889 std::string type = get_bmi_model()->get_analogous_cxx_type(get_bmi_model()->GetVarType(var_name),
-
890 varItemSize);
-
891 if (numItems != 1) {
-
892 //more than a single value needed for var_name
-
893 auto values = provider->get_values(CatchmentAggrDataSelector(this->get_catchment_id(),var_map_alias, model_epoch_time, t_delta,
-
894 get_bmi_model()->GetVarUnits(var_name)));
-
895 //need to marshal data types to the receiver as well
-
896 //this could be done a little more elegantly if the provider interface were
-
897 //"type aware", but for now, this will do (but requires yet another copy)
-
898 if(values.size() == 1){
-
899 //FIXME this isn't generic broadcasting, but works for scalar implementations
-
900 #ifndef NGEN_QUIET
-
901 std::cerr << "WARN: broadcasting variable '" << var_name << "' from scalar to expected array\n";
-
902 #endif
-
903 values.resize(numItems, values[0]);
-
904 } else if (values.size() != numItems) {
-
905 throw std::runtime_error("Mismatch in item count for variable '" + var_name + "': model expects " +
-
906 std::to_string(numItems) + ", provider returned " + std::to_string(values.size()) +
-
907 " items\n");
-
908 }
-
909 value_ptr = get_values_as_type( type, values.begin(), values.end() );
-
910
-
911 } else {
-
912 //scalar value
-
913 double value = provider->get_value(CatchmentAggrDataSelector(this->get_catchment_id(),var_map_alias, model_epoch_time, t_delta,
-
914 get_bmi_model()->GetVarUnits(var_name)));
-
915 value_ptr = get_value_as_type(type, value);
-
916 }
-
917 get_bmi_model()->SetValue(var_name, value_ptr.get());
-
918 }
-
919 }
-
-
920
- - -
925 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>> input_forcing_providers;
-
926
-
927 // Access for multi-BMI
- -
929
-
930 // Unit test access
-
931 friend class ::Bmi_Formulation_Test;
-
932 friend class ::Bmi_C_Formulation_Test;
-
933 friend class ::Bmi_Multi_Formulation_Test;
-
934 friend class ::Bmi_Cpp_Formulation_Test;
-
935 friend class ::Bmi_Cpp_Multi_Array_Test;
-
936
-
937 private:
- -
944 std::vector<std::string> available_forcings;
-
945 std::string bmi_init_config;
-
946 std::shared_ptr<M> bmi_model;
- - -
955 std::map<std::string, std::string> bmi_var_names_map;
- -
958 std::string forcing_file_path;
-
959 bool model_initialized = false;
-
960
-
-
961 std::vector<std::string> OPTIONAL_PARAMETERS = {
-
962 BMI_REALIZATION_CFG_PARAM_OPT__FORCING_FILE,
-
963 BMI_REALIZATION_CFG_PARAM_OPT__VAR_STD_NAMES,
-
964 BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS,
-
965 BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS,
-
966 BMI_REALIZATION_CFG_PARAM_OPT__OUTPUT_PRECISION,
-
967 BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END,
-
968 BMI_REALIZATION_CFG_PARAM_OPT__FIXED_TIME_STEP,
-
969 BMI_REALIZATION_CFG_PARAM_OPT__LIB_FILE
-
970 };
-
-
-
971 std::vector<std::string> REQUIRED_PARAMETERS = {
-
972 BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG,
-
973 BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR,
-
974 BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE,
-
975 BMI_REALIZATION_CFG_PARAM_REQ__USES_FORCINGS
-
976 };
-
-
977
-
978 };
-
-
979/*
-
980 template<class M>
-
981 void Bmi_Formulation<M>::create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global) {
-
982 geojson::PropertyMap options = this->interpret_parameters(config, global);
-
983 inner_create_formulation(options, false);
-
984 }
-
985
-
986 template<class M>
-
987 void Bmi_Formulation<M>::create_formulation(geojson::PropertyMap properties) {
-
988 inner_create_formulation(properties, true);
-
989 }
-
990
-
991 template<class M>
-
992 void Bmi_Formulation<M>::inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation) {
-
993 if (needs_param_validation) {
-
994 validate_parameters(properties);
-
995 }
-
996 // Required parameters first
-
997 set_bmi_init_config(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG).as_string());
-
998 set_bmi_main_output_var(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR).as_string());
-
999 set_forcing_file_path(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__FORCING_FILE).as_string());
-
1000 set_model_type_name(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE).as_string());
-
1001 set_bmi_using_forcing_file(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__USES_FORCINGS).as_boolean());
-
1002
-
1003 // Then optional ...
-
1004
-
1005 if (properties.find(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END) != properties.end()) {
-
1006 set_allow_model_exceed_end_time(
-
1007 properties.at(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END).as_boolean());
-
1008 }
-
1009
-
1010 // Do this next, since after checking whether other input variables are present in the properties, we can
-
1011 // now construct the adapter and init the model
-
1012 set_bmi_model(construct_model(properties));
-
1013
-
1014 // Output variable subset and order, if present
-
1015 auto out_var_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS);
-
1016 if (out_var_it != properties.end()) {
-
1017 std::vector<geojson::JSONProperty> out_vars_json_list = out_var_it->second.as_list();
-
1018 std::vector<std::string> out_vars(out_vars_json_list.size());
-
1019 for (int i = 0; i < out_vars_json_list.size(); ++i) {
-
1020 out_vars[i] = out_vars_json_list[i].as_string();
-
1021 }
-
1022 set_output_variable_names(out_vars);
-
1023 }
-
1024 // Otherwise, just take what literally is provided by the model
-
1025 else {
-
1026 set_output_variable_names(get_bmi_model()->GetOutputVarNames());
-
1027 }
-
1028
-
1029 // Output header fields, if present
-
1030 auto out_headers_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS);
-
1031 if (out_headers_it != properties.end()) {
-
1032 std::vector<geojson::JSONProperty> out_headers_json_list = out_var_it->second.as_list();
-
1033 std::vector<std::string> out_headers(out_headers_json_list.size());
-
1034 for (int i = 0; i < out_headers_json_list.size(); ++i) {
-
1035 out_headers[i] = out_headers_json_list[i].as_string();
-
1036 }
-
1037 set_output_header_fields(out_headers);
-
1038 }
-
1039 else {
-
1040 set_output_header_fields(get_output_variable_names());
-
1041 }
-
1042 }
-
1043 */
-
1044
-
1045}
-
1046
-
1047#endif //NGEN_BMI_MODULE_FORMULATION_H
+
328 void set_bmi_init_config(const std::string &init_config);
+
329
+
335 void set_bmi_model(std::shared_ptr<models::bmi::Bmi_Adapter> model);
+
336
+
337 void set_bmi_model_start_time_forcing_offset_s(const time_t &offset_s);
+
338
+
339 void set_bmi_model_time_step_fixed(bool is_fix_time_step);
+
340
+
346 void set_bmi_using_forcing_file(bool uses_forcing_file);
+
347
+
348 void set_forcing_file_path(const std::string &forcing_path);
+
349
+
355 virtual void set_model_initialized(bool is_initialized);
+
356
+
364 void set_model_inputs_prior_to_update(const double &model_init_time, time_step_t t_delta);
+
365
+ + +
370 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>> input_forcing_providers;
+
371
+
372 // Access for multi-BMI
+ +
374
+
375 // Unit test access
+
376 friend class ::Bmi_Formulation_Test;
+
377 friend class ::Bmi_C_Formulation_Test;
+
378 friend class ::Bmi_Multi_Formulation_Test;
+
379 friend class ::Bmi_Cpp_Formulation_Test;
+
380 friend class ::Bmi_Cpp_Multi_Array_Test;
+
381
+ +
402
+
403 private:
+ +
410 std::vector<std::string> available_forcings;
+
411 std::string bmi_init_config;
+
412 std::shared_ptr<models::bmi::Bmi_Adapter> bmi_model;
+ + +
421 std::map<std::string, std::string> bmi_var_names_map;
+ +
424 std::string forcing_file_path;
+
425 bool model_initialized = false;
+
426
+
+
427 std::vector<std::string> OPTIONAL_PARAMETERS = {
+
428 BMI_REALIZATION_CFG_PARAM_OPT__FORCING_FILE,
+
429 BMI_REALIZATION_CFG_PARAM_OPT__VAR_STD_NAMES,
+
430 BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS,
+
431 BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS,
+
432 BMI_REALIZATION_CFG_PARAM_OPT__OUTPUT_PRECISION,
+
433 BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END,
+
434 BMI_REALIZATION_CFG_PARAM_OPT__FIXED_TIME_STEP,
+
435 BMI_REALIZATION_CFG_PARAM_OPT__LIB_FILE
+
436 };
+
+
+
437 std::vector<std::string> REQUIRED_PARAMETERS = {
+
438 BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG,
+
439 BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR,
+
440 BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE,
+
441 BMI_REALIZATION_CFG_PARAM_REQ__USES_FORCINGS
+
442 };
+
+
443
+
444 };
+
+
445/*
+
446 template<class M>
+
447 void Bmi_Formulation<M>::create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global) {
+
448 geojson::PropertyMap options = this->interpret_parameters(config, global);
+
449 inner_create_formulation(options, false);
+
450 }
+
451
+
452 template<class M>
+
453 void Bmi_Formulation<M>::create_formulation(geojson::PropertyMap properties) {
+
454 inner_create_formulation(properties, true);
+
455 }
+
456
+
457 template<class M>
+
458 void Bmi_Formulation<M>::inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation) {
+
459 if (needs_param_validation) {
+
460 validate_parameters(properties);
+
461 }
+
462 // Required parameters first
+
463 set_bmi_init_config(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG).as_string());
+
464 set_bmi_main_output_var(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MAIN_OUT_VAR).as_string());
+
465 set_forcing_file_path(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__FORCING_FILE).as_string());
+
466 set_model_type_name(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__MODEL_TYPE).as_string());
+
467 set_bmi_using_forcing_file(properties.at(BMI_REALIZATION_CFG_PARAM_REQ__USES_FORCINGS).as_boolean());
+
468
+
469 // Then optional ...
+
470
+
471 if (properties.find(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END) != properties.end()) {
+
472 set_allow_model_exceed_end_time(
+
473 properties.at(BMI_REALIZATION_CFG_PARAM_OPT__ALLOW_EXCEED_END).as_boolean());
+
474 }
+
475
+
476 // Do this next, since after checking whether other input variables are present in the properties, we can
+
477 // now construct the adapter and init the model
+
478 set_bmi_model(construct_model(properties));
+
479
+
480 // Output variable subset and order, if present
+
481 auto out_var_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_VARS);
+
482 if (out_var_it != properties.end()) {
+
483 std::vector<geojson::JSONProperty> out_vars_json_list = out_var_it->second.as_list();
+
484 std::vector<std::string> out_vars(out_vars_json_list.size());
+
485 for (int i = 0; i < out_vars_json_list.size(); ++i) {
+
486 out_vars[i] = out_vars_json_list[i].as_string();
+
487 }
+
488 set_output_variable_names(out_vars);
+
489 }
+
490 // Otherwise, just take what literally is provided by the model
+
491 else {
+
492 set_output_variable_names(get_bmi_model()->GetOutputVarNames());
+
493 }
+
494
+
495 // Output header fields, if present
+
496 auto out_headers_it = properties.find(BMI_REALIZATION_CFG_PARAM_OPT__OUT_HEADER_FIELDS);
+
497 if (out_headers_it != properties.end()) {
+
498 std::vector<geojson::JSONProperty> out_headers_json_list = out_var_it->second.as_list();
+
499 std::vector<std::string> out_headers(out_headers_json_list.size());
+
500 for (int i = 0; i < out_headers_json_list.size(); ++i) {
+
501 out_headers[i] = out_headers_json_list[i].as_string();
+
502 }
+
503 set_output_header_fields(out_headers);
+
504 }
+
505 else {
+
506 set_output_header_fields(get_output_variable_names());
+
507 }
+
508 }
+
509 */
+
510
+
511}
+
512
+
513#endif //NGEN_BMI_MODULE_FORMULATION_H
This class is intended to be the virtual base for all data selectors used with the DataProvider API.
Definition DataProviderSelectors.hpp:13
-
std::string get_variable_name() const
Get the variable name for this selector.
Definition DataProviderSelectors.hpp:50
-
long get_duration_secs() const
Get the duration in seconds that is requested by this selector.
Definition DataProviderSelectors.hpp:64
-
std::string get_output_units() const
Get the output units that is requested by this selector.
Definition DataProviderSelectors.hpp:71
-
time_t get_init_time() const
Get the initial time for this selector.
Definition DataProviderSelectors.hpp:57
-
std::shared_ptr< data_access::GenericDataProvider > forcing
Definition HY_CatchmentRealization.hpp:54
-
static double get_converted_value(const std::string &in_units, const double &value, const std::string &out_units)
Definition UnitsHelper.cpp:58
-
static double * convert_values(const std::string &in_units, double *values, const std::string &out_units, double *out_values, const size_t &count)
Definition UnitsHelper.cpp:71
-
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.
-
Definition GenericDataProvider.hpp:10
Abstraction of formulation with backing model object(s) that implements the BMI.
Definition Bmi_Formulation.hpp:49
-
void set_bmi_main_output_var(const std::string &main_output_var)
Definition Bmi_Formulation.hpp:259
-
void set_output_precision(int precision)
Set the precision of output values when converted to text.
Definition Bmi_Formulation.hpp:211
-
virtual void set_model_type_name(std::string type_name)
Set the name of the specific type of the backing model object.
Definition Bmi_Formulation.hpp:268
-
std::string get_model_type_name()
Get the name of the specific type of the backing model object.
Definition Bmi_Formulation.hpp:139
-
virtual time_t convert_model_time(const double &model_time)=0
Convert a time value from the model to an epoch time in seconds.
-
const std::vector< std::string > & get_output_variable_names() const
Get the names of variables in formulation output.
Definition Bmi_Formulation.hpp:173
-
void set_output_variable_names(const std::vector< std::string > &out_var_names)
Set the names of variables in formulation output.
Definition Bmi_Formulation.hpp:284
-
void set_output_header_fields(const std::vector< std::string > &output_headers)
Definition Bmi_Formulation.hpp:272
-
virtual double get_var_value_as_double(const std::string &var_name)=0
Get value for some BMI model variable.
-
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:34
-
std::shared_ptr< M > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.hpp:454
-
long record_duration() override
Return the stride in the time dimension.
Definition Bmi_Module_Formulation.hpp:132
-
const std::string & get_config_mapped_variable_name(const std::string &model_var_name) override
When possible, translate a variable name for a BMI model to an internally recognized name.
Definition Bmi_Module_Formulation.hpp:172
-
time_t bmi_model_start_time_forcing_offset_s
The offset, converted to seconds, from the model's start time to the start time of the initial forcin...
Definition Bmi_Module_Formulation.hpp:953
-
void inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation)
Universal logic applied when creating a BMI-backed formulation from NGen config.
Definition Bmi_Module_Formulation.hpp:476
-
std::shared_ptr< void > get_value_as_type(std::string type, T value)
Definition Bmi_Module_Formulation.hpp:819
-
time_t get_variable_time_end(const std::string &varibale_name)
Get the exclusive ending of the period of time over which this instance can provide data for this for...
Definition Bmi_Module_Formulation.hpp:122
-
void set_bmi_using_forcing_file(bool uses_forcing_file)
Set whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.hpp:722
-
long get_data_start_time() override
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Module_Formulation.hpp:107
-
std::vector< std::string > OPTIONAL_PARAMETERS
Definition Bmi_Module_Formulation.hpp:961
-
bool bmi_using_forcing_file
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.hpp:957
-
std::vector< std::string > REQUIRED_PARAMETERS
Definition Bmi_Module_Formulation.hpp:971
-
std::shared_ptr< T > as_c_array(Iterator begin, Iterator end)
Template function for copying iterator range into contiguous array.
Definition Bmi_Module_Formulation.hpp:753
-
void set_allow_model_exceed_end_time(bool allow_exceed_end)
Definition Bmi_Module_Formulation.hpp:692
-
void determine_model_time_offset()
Determine and set the offset time of the model in seconds, compared to forcing data.
Definition Bmi_Module_Formulation.hpp:420
-
std::vector< std::string > available_forcings
The set of available "forcings" (output variables, plus their mapped aliases) that the model can prov...
Definition Bmi_Module_Formulation.hpp:944
-
std::shared_ptr< void > get_values_as_type(std::string type, Iterator begin, Iterator end)
Gets values in iterator range, casted based on type then returned as typeless (void) pointer.
Definition Bmi_Module_Formulation.hpp:779
-
bool allow_model_exceed_end_time
Whether model Update calls are allowed and handled in some way by the backing model for time steps af...
Definition Bmi_Module_Formulation.hpp:942
-
bool is_bmi_model_time_step_fixed() override
Test whether backing model has fixed time step size.
Definition Bmi_Module_Formulation.hpp:670
-
bool bmi_model_time_step_fixed
Whether backing model has fixed time step size.
Definition Bmi_Module_Formulation.hpp:948
-
long get_data_stop_time() override
Return the last valid time for which data from the requested variable can be requested.
Definition Bmi_Module_Formulation.hpp:127
-
bool is_model_initialized() override
Test whether the backing model object has been initialize using the BMI standard Initialize function.
Definition Bmi_Module_Formulation.hpp:688
-
virtual ~Bmi_Module_Formulation()
Definition Bmi_Module_Formulation.hpp:49
-
std::map< std::string, std::string > bmi_var_names_map
A configured mapping of BMI model variable names to standard names for use inside the framework.
Definition Bmi_Module_Formulation.hpp:955
-
const std::string & get_bmi_init_config() const
Definition Bmi_Module_Formulation.hpp:445
-
void set_bmi_model(std::shared_ptr< M > model)
Set the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.hpp:705
-
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Module_Formulation.hpp:324
-
const std::string & get_forcing_file_path() const override
Definition Bmi_Module_Formulation.hpp:458
-
bool is_var_name_in_collection(const std::vector< std::string > &all_names, const std::string &var_name)
Definition Bmi_Module_Formulation.hpp:332
-
double get_value(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the value of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Module_Formulation.hpp:277
-
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Module_Formulation.hpp:328
-
void set_bmi_model_time_step_fixed(bool is_fix_time_step)
Definition Bmi_Module_Formulation.hpp:713
-
const time_t & get_bmi_model_start_time_forcing_offset_s() override
Definition Bmi_Module_Formulation.hpp:462
-
boost::span< const std::string > get_available_variable_names() override
Get the collection of forcing output property names this instance can provide.
Definition Bmi_Module_Formulation.hpp:73
-
void set_initial_bmi_parameters(geojson::PropertyMap properties)
Check configuration properties for model_params and attempt to set them in the bmi model.
Definition Bmi_Module_Formulation.hpp:574
-
const double get_model_end_time() override
Get the end time for the backing BMI model in its native format and units.
Definition Bmi_Module_Formulation.hpp:150
-
bool is_property_sum_over_time_step(const std::string &name) override
Get whether a property's per-time-step values are each an aggregate sum over the entire time step.
Definition Bmi_Module_Formulation.hpp:354
-
time_step_t last_model_response_delta
The delta of the last model update execution (typically, this is time step size).
Definition Bmi_Module_Formulation.hpp:922
-
void set_model_inputs_prior_to_update(const double &model_init_time, time_step_t t_delta)
Set BMI input variable values for the model appropriately prior to calling its BMIupdate()``.
Definition Bmi_Module_Formulation.hpp:862
-
const std::vector< std::string > get_bmi_input_variables() override
Definition Bmi_Module_Formulation.hpp:359
-
std::shared_ptr< M > bmi_model
Definition Bmi_Module_Formulation.hpp:946
-
time_t last_model_response_start_time
The epoch time of the model at the beginning of its last update.
Definition Bmi_Module_Formulation.hpp:924
-
const double get_model_current_time() override
Get the current time for the backing BMI model in its native format and units.
Definition Bmi_Module_Formulation.hpp:141
-
void set_forcing_file_path(const std::string &forcing_path)
Definition Bmi_Module_Formulation.hpp:726
-
time_t get_variable_time_begin(const std::string &variable_name)
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Module_Formulation.hpp:93
-
void create_formulation(geojson::PropertyMap properties) override
Definition Bmi_Module_Formulation.hpp:56
-
void get_bmi_output_var_name(const std::string &name, std::string &bmi_var_name)
Get correct BMI variable name, which may be the output or something mapped to this output.
Definition Bmi_Module_Formulation.hpp:375
-
const bool & get_allow_model_exceed_end_time() const override
Get whether a model may perform updates beyond its end_time.
Definition Bmi_Module_Formulation.hpp:441
-
size_t get_ts_index_for_time(const time_t &epoch_time) override
Get the index of the forcing time step that contains the given point in time.
Definition Bmi_Module_Formulation.hpp:193
-
bool is_bmi_using_forcing_file() const override
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.hpp:679
-
const std::vector< std::string > & get_required_parameters() override
Definition Bmi_Module_Formulation.hpp:154
-
void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) override
Definition Bmi_Module_Formulation.hpp:51
-
const std::vector< std::string > get_bmi_output_variables() override
Definition Bmi_Module_Formulation.hpp:363
-
virtual void set_model_initialized(bool is_initialized)
Set whether the backing model object has been initialize using the BMI standard Initialize function.
Definition Bmi_Module_Formulation.hpp:735
-
std::string forcing_file_path
Definition Bmi_Module_Formulation.hpp:958
-
Bmi_Module_Formulation(std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing_provider, utils::StreamHandler output_stream)
Minimal constructor for objects initialize using the Formulation_Manager and subsequent calls to crea...
Definition Bmi_Module_Formulation.hpp:46
-
bool model_initialized
Definition Bmi_Module_Formulation.hpp:959
-
std::string bmi_init_config
Definition Bmi_Module_Formulation.hpp:945
-
std::map< std::string, std::shared_ptr< data_access::GenericDataProvider > > input_forcing_providers
Definition Bmi_Module_Formulation.hpp:925
-
void set_bmi_init_config(const std::string &init_config)
Definition Bmi_Module_Formulation.hpp:696
-
std::vector< double > get_values(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m=SUM) override
Get the 1D values of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Module_Formulation.hpp:209
-
virtual std::shared_ptr< M > construct_model(const geojson::PropertyMap &properties)=0
Construct model and its shared pointer, potentially supplying input variable values from config.
-
void set_bmi_model_start_time_forcing_offset_s(const time_t &offset_s)
Definition Bmi_Module_Formulation.hpp:709
-
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:24
-
std::string get_catchment_id() override
Definition Catchment_Formulation.hpp:95
-
virtual std::string get_formulation_type()=0
-
virtual geojson::PropertyMap interpret_parameters(boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr)
Definition Formulation.hpp:102
+
Abstraction of a formulation with a single backing model object that implements the BMI.
Definition Bmi_Module_Formulation.hpp:27
+
size_t get_ts_index_for_time(const time_t &epoch_time) override
Get the index of the forcing time step that contains the given point in time.
Definition Bmi_Module_Formulation.cpp:79
+
void get_bmi_output_var_name(const std::string &name, std::string &bmi_var_name)
Get correct BMI variable name, which may be the output or something mapped to this output.
Definition Bmi_Module_Formulation.cpp:208
+
void set_bmi_init_config(const std::string &init_config)
Definition Bmi_Module_Formulation.cpp:530
+
bool is_bmi_using_forcing_file() const override
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.cpp:518
+
Bmi_Module_Formulation(std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing_provider, utils::StreamHandler output_stream)
Minimal constructor for objects initialize using the Formulation_Manager and subsequent calls to crea...
Definition Bmi_Module_Formulation.hpp:39
+
time_t get_variable_time_begin(const std::string &variable_name)
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Module_Formulation.cpp:40
+
bool bmi_model_time_step_fixed
Whether backing model has fixed time step size.
Definition Bmi_Module_Formulation.hpp:414
+
std::map< std::string, std::string > bmi_var_names_map
A configured mapping of BMI model variable names to standard names for use inside the framework.
Definition Bmi_Module_Formulation.hpp:421
+
std::shared_ptr< models::bmi::Bmi_Adapter > bmi_model
Definition Bmi_Module_Formulation.hpp:412
+
std::string bmi_init_config
Definition Bmi_Module_Formulation.hpp:411
+
const std::string & get_config_mapped_variable_name(const std::string &model_var_name) override
When possible, translate a variable name for a BMI model to an internally recognized name.
Definition Bmi_Module_Formulation.cpp:71
+
std::vector< std::string > REQUIRED_PARAMETERS
Definition Bmi_Module_Formulation.hpp:437
+
void set_bmi_model_time_step_fixed(bool is_fix_time_step)
Definition Bmi_Module_Formulation.cpp:541
+
const std::string & get_bmi_init_config() const
Definition Bmi_Module_Formulation.cpp:243
+
std::vector< std::string > OPTIONAL_PARAMETERS
Definition Bmi_Module_Formulation.hpp:427
+
bool is_bmi_model_time_step_fixed() override
Test whether backing model has fixed time step size.
Definition Bmi_Module_Formulation.cpp:514
+
const double get_model_end_time() override
Get the end time for the backing BMI model in its native format and units.
Definition Bmi_Module_Formulation.cpp:63
+
void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) override
Definition Bmi_Module_Formulation.cpp:6
+
boost::span< const std::string > get_available_variable_names() override
Get the collection of forcing output property names this instance can provide.
Definition Bmi_Module_Formulation.cpp:15
+
std::string forcing_file_path
Definition Bmi_Module_Formulation.hpp:424
+
bool is_model_initialized() override
Test whether the backing model object has been initialize using the BMI standard Initialize function.
Definition Bmi_Module_Formulation.cpp:522
+
time_t last_model_response_start_time
The epoch time of the model at the beginning of its last update.
Definition Bmi_Module_Formulation.hpp:369
+
void set_forcing_file_path(const std::string &forcing_path)
Definition Bmi_Module_Formulation.cpp:549
+
std::vector< std::string > available_forcings
The set of available "forcings" (output variables, plus their mapped aliases) that the model can prov...
Definition Bmi_Module_Formulation.hpp:410
+
bool is_property_sum_over_time_step(const std::string &name) override
Get whether a property's per-time-step values are each an aggregate sum over the entire time step.
Definition Bmi_Module_Formulation.cpp:195
+
const std::vector< std::string > & get_required_parameters() override
Definition Bmi_Module_Formulation.cpp:67
+
int next_time_step_index
Index value (0-based) of the time step that will be processed by the next update of the model.
Definition Bmi_Module_Formulation.hpp:401
+
long record_duration() override
Return the stride in the time dimension.
Definition Bmi_Module_Formulation.cpp:55
+
const time_t & get_bmi_model_start_time_forcing_offset_s() override
Definition Bmi_Module_Formulation.cpp:255
+
bool bmi_using_forcing_file
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.hpp:423
+
void inner_create_formulation(geojson::PropertyMap properties, bool needs_param_validation)
Universal logic applied when creating a BMI-backed formulation from NGen config.
Definition Bmi_Module_Formulation.cpp:259
+
std::map< std::string, std::shared_ptr< data_access::GenericDataProvider > > input_forcing_providers
Definition Bmi_Module_Formulation.hpp:370
+
virtual std::shared_ptr< models::bmi::Bmi_Adapter > construct_model(const geojson::PropertyMap &properties)=0
Construct model and its shared pointer, potentially supplying input variable values from config.
+
std::vector< double > get_values(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m=SUM) override
Get the 1D values of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Module_Formulation.cpp:84
+
long get_data_start_time() override
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Module_Formulation.cpp:45
+
void set_bmi_model(std::shared_ptr< models::bmi::Bmi_Adapter > model)
Set the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.cpp:533
+
long get_data_stop_time() override
Return the last valid time for which data from the requested variable can be requested.
Definition Bmi_Module_Formulation.cpp:50
+
double get_value(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the value of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Module_Formulation.cpp:135
+
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Module_Formulation.cpp:187
+
void set_bmi_model_start_time_forcing_offset_s(const time_t &offset_s)
Definition Bmi_Module_Formulation.cpp:537
+
void determine_model_time_offset()
Determine and set the offset time of the model in seconds, compared to forcing data.
Definition Bmi_Module_Formulation.cpp:233
+
void set_initial_bmi_parameters(geojson::PropertyMap properties)
Check configuration properties for model_params and attempt to set them in the bmi model.
Definition Bmi_Module_Formulation.cpp:424
+
std::string get_output_line_for_timestep(int timestep, std::string delimiter) override
Get a delimited string with all the output variable values for the given time step.
Definition Bmi_Module_Formulation.cpp:26
+
const bool & get_allow_model_exceed_end_time() const override
Get whether a model may perform updates beyond its end_time.
Definition Bmi_Module_Formulation.cpp:239
+
bool model_initialized
Definition Bmi_Module_Formulation.hpp:425
+
std::shared_ptr< models::bmi::Bmi_Adapter > get_bmi_model()
Get the backing model object implementing the BMI.
Definition Bmi_Module_Formulation.cpp:247
+
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Module_Formulation.cpp:191
+
const std::string & get_forcing_file_path() const override
Definition Bmi_Module_Formulation.cpp:251
+
void set_allow_model_exceed_end_time(bool allow_exceed_end)
Definition Bmi_Module_Formulation.cpp:526
+
virtual void set_model_initialized(bool is_initialized)
Set whether the backing model object has been initialize using the BMI standard Initialize function.
Definition Bmi_Module_Formulation.cpp:553
+
void set_model_inputs_prior_to_update(const double &model_init_time, time_step_t t_delta)
Set BMI input variable values for the model appropriately prior to calling its BMIupdate()``.
Definition Bmi_Module_Formulation.cpp:595
+
void set_bmi_using_forcing_file(bool uses_forcing_file)
Set whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Module_Formulation.cpp:545
+
bool allow_model_exceed_end_time
Whether model Update calls are allowed and handled in some way by the backing model for time steps af...
Definition Bmi_Module_Formulation.hpp:408
+
~Bmi_Module_Formulation() override=default
+
time_t bmi_model_start_time_forcing_offset_s
The offset, converted to seconds, from the model's start time to the start time of the initial forcin...
Definition Bmi_Module_Formulation.hpp:419
+
time_step_t last_model_response_delta
The delta of the last model update execution (typically, this is time step size).
Definition Bmi_Module_Formulation.hpp:367
+
const std::vector< std::string > get_bmi_output_variables() override
Definition Bmi_Module_Formulation.cpp:204
+
const std::vector< std::string > get_bmi_input_variables() override
Definition Bmi_Module_Formulation.cpp:200
+
const double get_model_current_time() override
Get the current time for the backing BMI model in its native format and units.
Definition Bmi_Module_Formulation.cpp:59
+
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:25
std::string id
Definition Formulation.hpp:147
-
virtual void validate_parameters(geojson::PropertyMap options)
Definition Formulation.hpp:122
long time_step_t
Definition Formulation.hpp:21
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
ReSampleMethod
An abstraction for classes that provides access to data.
Definition DataProvider.hpp:17
@ SUM
Definition DataProvider.hpp:19
@ MEAN
Definition DataProvider.hpp:18
-
static std::string get_propertytype_name(PropertyType &&property_type)
Definition JSONProperty.hpp:144
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
- - - -
void warning(const char *msg)
Send warning to std::cerr.
Definition logging_utils.cpp:26
Definition Bmi_C_Formulation.hpp:11
@@ -1076,7 +412,7 @@ diff --git a/_bmi___multi___formulation_8hpp_source.html b/_bmi___multi___formulation_8hpp_source.html index 420c6333e9..a22659cb85 100644 --- a/_bmi___multi___formulation_8hpp_source.html +++ b/_bmi___multi___formulation_8hpp_source.html @@ -108,470 +108,471 @@
9#include "GenericDataProvider.hpp"
10#include "OptionalWrappedDataProvider.hpp"
11#include "ConfigurationException.hpp"
-
12
-
13#define BMI_REALIZATION_CFG_PARAM_REQ__MODULES "modules"
-
14#define BMI_REALIZATION_CFG_PARAM_OPT__DEFAULT_OUT_VALS "default_output_values"
-
15
-
16class Bmi_Multi_Formulation_Test;
-
17class Bmi_Cpp_Multi_Array_Test;
-
18
-
19namespace realization {
-
20
-
- -
25
-
26 public:
-
27
- -
29 typedef std::shared_ptr<nested_module_type> nested_module_ptr;
-
30
-
-
39 Bmi_Multi_Formulation(std::string id, std::shared_ptr<data_access::GenericDataProvider> forcing_provider, utils::StreamHandler output_stream)
-
40 : Bmi_Formulation(std::move(id), forcing_provider, output_stream) { };
-
-
41
- -
43
-
-
58 time_t convert_model_time(const double &model_time) override {
- -
60 }
-
-
61
-
-
75 inline time_t convert_model_time(const double &model_time, int module_index) {
-
76 return modules[module_index]->convert_model_time(model_time);
-
77 }
-
-
78
-
-
79 void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global = nullptr) override {
-
80 geojson::PropertyMap options = this->interpret_parameters(config, global);
-
81 create_multi_formulation(options, false);
-
82 }
-
-
83
-
-
84 void create_formulation(geojson::PropertyMap properties) override {
-
85 create_multi_formulation(properties, true);
-
86 }
-
-
87
-
103 const bool &get_allow_model_exceed_end_time() const override;
-
104
-
119 boost::span <const std::string> get_available_variable_names() override;
-
120
-
-
127 const std::vector<std::string> get_bmi_input_variables() override {
-
128 return modules[0]->get_bmi_input_variables();
-
129 }
-
-
130
-
131 const time_t &get_bmi_model_start_time_forcing_offset_s() override;
-
132
-
-
138 const std::vector<std::string> get_bmi_output_variables() override {
-
139 return modules.back()->get_bmi_output_variables();
-
140 }
-
-
141
-
162 const std::string &get_config_mapped_variable_name(const std::string &model_var_name) override;
-
163
-
180 const std::string &get_config_mapped_variable_name(const std::string &model_var_name, bool check_first, bool check_last);
-
181
-
206 const std::string &get_config_mapped_variable_name(const std::string &output_var_name,
-
207 const shared_ptr<Bmi_Formulation>& out_module,
-
208 const shared_ptr<Bmi_Formulation>& in_module);
-
209
-
210 const std::string &get_forcing_file_path() const override;
-
211
-
-
223 long get_data_start_time() override
-
224 {
-
225 return get_variable_time_begin("");
-
226 }
-
-
227
-
-
238 time_t get_variable_time_begin(const std::string &variable_name) {
-
239 std::string var_name = variable_name;
-
240 // when unspecified, assume all data is available for the same range.
-
241 // If no var_name, use forcing ...
-
242 if(var_name == "*" || var_name == ""){
-
243 return forcing->get_data_start_time();
-
244 }
-
245 // If not found ...
-
246 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
-
247 throw std::runtime_error(get_formulation_type() + " cannot get output time for unknown \"" + variable_name + "\"");
-
248 }
-
249 return availableData[var_name]->get_data_start_time();
-
250 }
-
-
251
-
-
262 long get_data_stop_time() override
-
263 {
-
264 return get_variable_time_end("");
-
265 }
-
-
266
-
276 //time_t get_forcing_output_time_end(const std::string &forcing_name) {
-
-
277 time_t get_variable_time_end(const std::string &variable_name) {
-
278 // when unspecified, assume all data is available for the same range.
-
279 // If no var_name, use forcing ...
-
280 std::string var_name = variable_name;
-
281 if(var_name == "*" || var_name == ""){
-
282 return forcing->get_data_stop_time();
-
283 }
-
284 // If not found ...
-
285 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
-
286 throw std::runtime_error(get_formulation_type() + " cannot get output time for unknown \"" + variable_name + "\"");
-
287 }
-
288 return availableData[var_name]->get_data_stop_time();
-
289 }
-
-
290
-
-
291 long record_duration() override
-
292 {
-
293 std::string var_name;
-
294 for(std::map<std::string,std::shared_ptr<data_access::GenericDataProvider>>::iterator iter = availableData.begin(); iter != availableData.end(); ++iter)
-
295 {
-
296 var_name = iter->first;
-
297 //TODO: Find a probably more performant way than trial and exception here.
-
298 try {
-
299 time_t rv = availableData[var_name]->record_duration();
-
300 return rv;
-
301 }
-
302 catch (...){
-
303 continue;
-
304 }
-
305 break;
-
306 }
-
307
-
308 // If not found ...
-
309 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
-
310 throw std::runtime_error(get_formulation_type() + " cannot get output record duration for unknown \"" + var_name + "\"");
-
311 }
-
312 return availableData[var_name]->record_duration();
-
313 }
-
-
314
-
-
315 std::string get_formulation_type() override {
-
316 return "bmi_multi";
-
317 }
-
-
318
-
-
324 const double get_model_current_time() override {
-
325 return modules[get_index_for_primary_module()]->get_model_current_time();
-
326 }
-
-
327
-
-
333 const double get_model_end_time() override {
-
334 return modules[get_index_for_primary_module()]->get_model_end_time();
-
335 }
-
-
336
-
-
342 const double get_model_start_time() {
-
343 return modules[get_index_for_primary_module()]->get_data_start_time();
-
344 }
-
-
345
-
346 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
-
347
-
348 double get_response(time_step_t t_index, time_step_t t_delta) override;
-
349
-
-
363 size_t get_ts_index_for_time(const time_t &epoch_time) override {
-
364 // TODO: come back and implement if actually necessary for this type; for now don't use
-
365 throw std::runtime_error("Bmi_Multi_Formulation does not yet implement get_ts_index_for_time");
-
366 }
-
-
367
-
- -
390 {
-
391 std::string output_name = selector.get_variable_name();
-
392 time_t init_time = selector.get_init_time();
-
393 long duration_s = selector.get_duration_secs();
-
394 std::string output_units = selector.get_output_units();
-
395
-
396 // If not found ...
-
397 if (availableData.empty() || availableData.find(output_name) == availableData.end()) {
-
398 throw std::runtime_error(get_formulation_type() + " cannot get output value for unknown " + output_name + SOURCE_LOC);
-
399 }
-
400 return availableData[output_name]->get_value(CatchmentAggrDataSelector(this->get_catchment_id(),output_name, init_time, duration_s, output_units), m);
-
401 }
-
-
402
-
-
403 std::vector<double> get_values(const CatchmentAggrDataSelector& selector, data_access::ReSampleMethod m) override
-
404 {
-
405 std::string output_name = selector.get_variable_name();
-
406 time_t init_time = selector.get_init_time();
-
407 long duration_s = selector.get_duration_secs();
-
408 std::string output_units = selector.get_output_units();
-
409
-
410 if (availableData.empty() || availableData.find(output_name) == availableData.end()) {
-
411 throw std::runtime_error(get_formulation_type() + " cannot get output values for unknown " + output_name + SOURCE_LOC);
-
412 }
-
413 return availableData[output_name]->get_values(CatchmentAggrDataSelector(this->get_catchment_id(),output_name, init_time, duration_s, output_units), m);
-
414 }
-
-
415
-
416 bool is_bmi_input_variable(const std::string &var_name) override;
-
417
-
423 bool is_bmi_model_time_step_fixed() override;
-
424
-
425 bool is_bmi_output_variable(const std::string &var_name) override;
-
426
-
427 bool is_bmi_using_forcing_file() const override;
-
428
-
434 bool is_model_initialized() override;
-
435
-
-
454 bool is_property_sum_over_time_step(const std::string &name) override {
-
455 if (availableData.empty() || availableData.find(name) == availableData.end()) {
-
456 throw std::runtime_error(
-
457 get_formulation_type() + " cannot get whether unknown property " + name + " is summation");
-
458 }
-
459 return availableData[name]->is_property_sum_over_time_step(name);
-
460 }
-
-
461
-
468 bool is_time_step_beyond_end_time(time_step_t t_index);
-
469
-
- - -
477 }
-
-
478
-
-
487 inline void set_index_for_primary_module(int index) {
-
488 if (index < modules.size()) {
-
489 primary_module_index = index;
-
490 }
-
491 }
-
-
492
-
- -
497 // variable already checked
- -
499 return;
-
500 }
-
501
-
502 // get bmi_multi global output variable names
-
503 const std::vector<std::string> &output_var_names = get_output_variable_names();
-
504
-
505 // store variable names in avaialbleData in the valid output variable name list
-
506 std::vector<std::string> available_var_names;
-
507 std::string var_name;
-
508 for(std::map<std::string,std::shared_ptr<data_access::GenericDataProvider>>::iterator iter = availableData.begin(); iter != availableData.end(); ++iter)
-
509 {
-
510 var_name = iter->first;
-
511 available_var_names.push_back(var_name);
-
512 }
-
513
-
514 // check if an output variable listed in the bmi_multi global is a valid variable
-
515 for (int i = 0; i < output_var_names.size(); ++i) {
-
516 auto it = std::find(available_var_names.begin(), available_var_names.end(), output_var_names[i]);
-
517 if (it == available_var_names.end()) {
-
518 throw std::runtime_error(output_var_names[i] + " does not exist in the output name list" + SOURCE_LOC);
-
519 }
-
520 }
-
521 }
-
-
522
-
523 protected:
-
524
-
531 void create_multi_formulation(geojson::PropertyMap properties, bool needs_param_validation);
-
532
-
533 template<class T>
-
-
534 double get_module_var_value_as_double(const std::string &var_name, std::shared_ptr<Bmi_Formulation> mod) {
-
535 std::shared_ptr<T> module = std::static_pointer_cast<T>(mod);
-
536 return module->get_var_value_as_double(var_name);
-
537 }
-
-
538
-
-
549 double get_var_value_as_double(const std::string &var_name) override {
-
550 return get_var_value_as_double(0, var_name);
-
551 }
-
-
552
-
-
577 double get_var_value_as_double(const int& index, const std::string& var_name) override {
-
578 auto data_provider_iter = availableData.find(var_name);
-
579 if (data_provider_iter == availableData.end()) {
- -
581 "Multi BMI formulation can't find correct nested module for BMI variable " + var_name + SOURCE_LOC);
-
582 }
-
583 // Otherwise, we have a provider, and we can cast it based on the documented assumptions
-
584 try {
-
585 std::shared_ptr <data_access::GenericDataProvider> nested_module =
-
586 std::dynamic_pointer_cast<data_access::GenericDataProvider>(data_provider_iter->second);
-
587 long nested_module_time = nested_module->get_data_start_time() + ( this->get_model_current_time() - this->get_model_start_time() );
-
588 auto selector = CatchmentAggrDataSelector(this->get_catchment_id(),var_name,nested_module_time,this->record_duration(),"1");
-
589 //TODO: After merge PR#405, try re-adding support for index
-
590 return nested_module->get_value(selector);
-
591 }
-
592 // If there was any problem with the cast and extraction of the value, throw runtime error
-
593 catch (std::exception &e) {
-
594 throw std::runtime_error("Multi BMI formulation can't use associated data provider as a nested module"
-
595 " when attempting to get values of BMI variable " + var_name + SOURCE_LOC);
-
596 // TODO: look at adjusting defs to move this function up in class hierarchy (or at least add TODO there)
-
597 }
-
598 }
-
-
599
-
- -
610 for (int d = 0; d < deferredProviders.size(); ++d) {
-
611 std::shared_ptr<data_access::OptionalWrappedDataProvider> &deferredProvider = deferredProviders[d];
-
612 // Skip doing anything for any deferred provider that already has its backing provider set
-
613 if (deferredProvider->isWrappedProviderSet())
-
614 continue;
-
615
-
616 // TODO: improve this later; since defaults can be used, it is technically possible to grab something
-
617 // valid when something more appropriate would later be available
-
618 // Iterate through available data providers and set association once a sufficient one is found
-
619 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>>::iterator avail_it;
-
620 for (avail_it = availableData.begin(); avail_it != availableData.end(); avail_it++) {
-
621 // If this satisfies everything this deferred provider needs to provide, and thus can be/was set ...
-
622 if (deferredProvider->setWrappedProvider(avail_it->second.get())) {
-
623 break;
-
624 }
-
625 }
-
626
-
627 // If none of the available data providers could be used for this deferred one, throw exception
-
628 if (!deferredProvider->isWrappedProviderSet()) {
-
629 // TODO: this probably needs to be some kind of custom configuration exception
-
630 std::string msg = "Multi BMI formulation cannot be created from config: cannot find available data "
-
631 "provider to satisfy set of deferred provisions for nested module at index "
-
632 + std::to_string(deferredProviderModuleIndices[d]) + ": {";
-
633 // There must always be at least 1; get manually to help with formatting
-
634 msg += deferredProvider->get_available_variable_names()[0];
-
635 // And here make sure to start at 1 instead of 0
-
636 for (int i = 1; i < deferredProvider->get_available_variable_names().size(); ++i)
-
637 msg += ", " + deferredProvider->get_available_variable_names()[i];
-
638 msg += "}";
- -
640 }
-
641 }
-
642 }
-
-
643
-
659 template<class T>
-
-
660 std::shared_ptr<T> init_nested_module(int mod_index, std::string identifier, geojson::PropertyMap properties) {
-
661 std::shared_ptr<data_access::GenericDataProvider> wfp = std::make_shared<data_access::WrappedDataProvider>(this);
-
662 std::shared_ptr<T> mod = std::make_shared<T>(identifier, wfp, output);
-
663
-
664 // Since this is a nested formulation, support usage of the '{{id}}' syntax for init config file paths.
-
665 Catchment_Formulation::config_pattern_substitution(properties, BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG,
-
666 "{{id}}", id);
-
667
-
668 // Call create_formulation to perform the rest of the typical initialization steps for the formulation.
-
669 mod->create_formulation(properties);
-
670
-
671 // Set this up for placing in the module_variable_maps member variable
-
672 std::shared_ptr<std::map<std::string, std::string>> var_aliases;
-
673 var_aliases = std::make_shared<std::map<std::string, std::string>>(std::map<std::string, std::string>());
-
674 for (const std::string &var_name : mod->get_bmi_input_variables()) {
-
675 std::string framework_alias = mod->get_config_mapped_variable_name(var_name);
-
676 (*var_aliases)[framework_alias] = var_name;
-
677 // If framework_name is not yet in collection from which we have available data sources ...
-
678 if (availableData.count(framework_alias) != 1) {
-
679 setup_nested_deferred_provider(var_name, framework_alias, mod, mod_index);
-
680 }
-
681 else {
-
682 mod->input_forcing_providers[var_name] = availableData[framework_alias];
-
683 mod->input_forcing_providers[framework_alias] = availableData[framework_alias];
-
684 }
-
685 }
-
686
-
687 // Also add the output variable aliases
-
688 for (const std::string &var_name : mod->get_bmi_output_variables()) {
-
689 std::string framework_alias = mod->get_config_mapped_variable_name(var_name);
-
690 (*var_aliases)[framework_alias] = var_name;
-
691 if (availableData.count(framework_alias) > 0) {
-
692 throw std::runtime_error(
-
693 "Multi BMI cannot be created with module " + mod->get_model_type_name() +
-
694 " with output variable " + framework_alias +
-
695 (var_name == framework_alias ? "" : " (an alias of BMI variable " + var_name + ")") +
-
696 " because a previous module is using this output variable name/alias.");
-
697 }
-
698 availableData[framework_alias] = mod;
-
699 }
-
700 module_variable_maps[mod_index] = var_aliases;
-
701 return mod;
-
702 }
-
-
703
-
712 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>> availableData;
-
713
-
714 private:
-
715
-
731 template<class T>
-
-
732 void setup_nested_deferred_provider(const std::string &bmi_input_var_name,
-
733 const std::string &framework_output_name,
-
734 std::shared_ptr<T> mod,
-
735 int mod_index) {
-
736 // TODO: probably don't actually need bmi_input_var_name, and just can deal with framework_output_name
-
737 // Create deferred, optional provider for providing this
-
738 // Only include BMI variable name, as that's what'll be visible when associating to backing provider
-
739 // It's "deferred" in that we'll set the backing later.
-
740 // It's "optional" in that it waits to use backing provider, using the default some number of times
-
741 std::shared_ptr<data_access::OptionalWrappedDataProvider> provider;
-
742 // TODO: make sure only alias is needed
-
743 auto defs_it = default_output_values.find(framework_output_name);
-
744 if (defs_it != default_output_values.end()) {
-
745 // TODO: consider also reading wait count from config
-
746 provider = std::make_shared<data_access::OptionalWrappedDataProvider>(framework_output_name, defs_it->second, 1);
-
747 }
-
748 else {
-
749 provider = std::make_shared<data_access::OptionalWrappedDataProvider>(framework_output_name);
-
750 }
-
751
-
752 // Add deferred to collection and module index to collection
-
753 deferredProviders.push_back(provider);
-
754 deferredProviderModuleIndices.push_back(mod_index);
-
755 // Assign as provider within module
-
756 // TODO: per TODO at top, probably can replace bmi_input_var_name here with framework_output_name
-
757 mod->input_forcing_providers[bmi_input_var_name] = provider;
-
758 }
-
-
759
-
761 std::vector<std::string> available_forcings;
-
765 std::map<std::string, double> default_output_values;
-
774 std::vector<std::shared_ptr<data_access::OptionalWrappedDataProvider>> deferredProviders;
-
775
- - -
789 std::vector<nested_module_ptr> modules;
-
790 std::vector<std::string> module_types;
-
794 // TODO: confirm that we actually need this for something
-
795 std::vector<std::shared_ptr<std::map<std::string, std::string>>> module_variable_maps;
- - -
800
- -
802 friend class ::Bmi_Cpp_Multi_Array_Test;
-
803
-
804 };
-
-
805}
-
806
-
807#endif //NGEN_BMI_MULTI_FORMULATION_HPP
+
12#include "ExternalIntegrationException.hpp"
+
13
+
14#define BMI_REALIZATION_CFG_PARAM_REQ__MODULES "modules"
+
15#define BMI_REALIZATION_CFG_PARAM_OPT__DEFAULT_OUT_VALS "default_output_values"
+
16
+
17class Bmi_Multi_Formulation_Test;
+
18class Bmi_Cpp_Multi_Array_Test;
+
19
+
20namespace realization {
+
21
+
+ +
26
+
27 public:
+
28
+ +
30 typedef std::shared_ptr<nested_module_type> nested_module_ptr;
+
31
+
+
40 Bmi_Multi_Formulation(std::string id, std::shared_ptr<data_access::GenericDataProvider> forcing_provider, utils::StreamHandler output_stream)
+
41 : Bmi_Formulation(std::move(id), forcing_provider, output_stream) { };
+
+
42
+ +
44
+
+
59 time_t convert_model_time(const double &model_time) override {
+ +
61 }
+
+
62
+
+
76 inline time_t convert_model_time(const double &model_time, int module_index) {
+
77 return modules[module_index]->convert_model_time(model_time);
+
78 }
+
+
79
+
+
80 void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global = nullptr) override {
+
81 geojson::PropertyMap options = this->interpret_parameters(config, global);
+
82 create_multi_formulation(options, false);
+
83 }
+
+
84
+
+
85 void create_formulation(geojson::PropertyMap properties) override {
+
86 create_multi_formulation(properties, true);
+
87 }
+
+
88
+
104 const bool &get_allow_model_exceed_end_time() const override;
+
105
+
120 boost::span <const std::string> get_available_variable_names() override;
+
121
+
+
128 const std::vector<std::string> get_bmi_input_variables() override {
+
129 return modules[0]->get_bmi_input_variables();
+
130 }
+
+
131
+
132 const time_t &get_bmi_model_start_time_forcing_offset_s() override;
+
133
+
+
139 const std::vector<std::string> get_bmi_output_variables() override {
+
140 return modules.back()->get_bmi_output_variables();
+
141 }
+
+
142
+
163 const std::string &get_config_mapped_variable_name(const std::string &model_var_name) override;
+
164
+
181 const std::string &get_config_mapped_variable_name(const std::string &model_var_name, bool check_first, bool check_last);
+
182
+
207 const std::string &get_config_mapped_variable_name(const std::string &output_var_name,
+
208 const shared_ptr<Bmi_Formulation>& out_module,
+
209 const shared_ptr<Bmi_Formulation>& in_module);
+
210
+
211 const std::string &get_forcing_file_path() const override;
+
212
+
+
224 long get_data_start_time() override
+
225 {
+
226 return get_variable_time_begin("");
+
227 }
+
+
228
+
+
239 time_t get_variable_time_begin(const std::string &variable_name) {
+
240 std::string var_name = variable_name;
+
241 // when unspecified, assume all data is available for the same range.
+
242 // If no var_name, use forcing ...
+
243 if(var_name == "*" || var_name == ""){
+
244 return forcing->get_data_start_time();
+
245 }
+
246 // If not found ...
+
247 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
+
248 throw std::runtime_error(get_formulation_type() + " cannot get output time for unknown \"" + variable_name + "\"");
+
249 }
+
250 return availableData[var_name]->get_data_start_time();
+
251 }
+
+
252
+
+
263 long get_data_stop_time() override
+
264 {
+
265 return get_variable_time_end("");
+
266 }
+
+
267
+
277 //time_t get_forcing_output_time_end(const std::string &forcing_name) {
+
+
278 time_t get_variable_time_end(const std::string &variable_name) {
+
279 // when unspecified, assume all data is available for the same range.
+
280 // If no var_name, use forcing ...
+
281 std::string var_name = variable_name;
+
282 if(var_name == "*" || var_name == ""){
+
283 return forcing->get_data_stop_time();
+
284 }
+
285 // If not found ...
+
286 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
+
287 throw std::runtime_error(get_formulation_type() + " cannot get output time for unknown \"" + variable_name + "\"");
+
288 }
+
289 return availableData[var_name]->get_data_stop_time();
+
290 }
+
+
291
+
+
292 long record_duration() override
+
293 {
+
294 std::string var_name;
+
295 for(std::map<std::string,std::shared_ptr<data_access::GenericDataProvider>>::iterator iter = availableData.begin(); iter != availableData.end(); ++iter)
+
296 {
+
297 var_name = iter->first;
+
298 //TODO: Find a probably more performant way than trial and exception here.
+
299 try {
+
300 time_t rv = availableData[var_name]->record_duration();
+
301 return rv;
+
302 }
+
303 catch (...){
+
304 continue;
+
305 }
+
306 break;
+
307 }
+
308
+
309 // If not found ...
+
310 if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
+
311 throw std::runtime_error(get_formulation_type() + " cannot get output record duration for unknown \"" + var_name + "\"");
+
312 }
+
313 return availableData[var_name]->record_duration();
+
314 }
+
+
315
+
+
316 std::string get_formulation_type() override {
+
317 return "bmi_multi";
+
318 }
+
+
319
+
+
325 const double get_model_current_time() override {
+
326 return modules[get_index_for_primary_module()]->get_model_current_time();
+
327 }
+
+
328
+
+
334 const double get_model_end_time() override {
+
335 return modules[get_index_for_primary_module()]->get_model_end_time();
+
336 }
+
+
337
+
+
343 const double get_model_start_time() {
+
344 return modules[get_index_for_primary_module()]->get_data_start_time();
+
345 }
+
+
346
+
347 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
+
348
+
349 double get_response(time_step_t t_index, time_step_t t_delta) override;
+
350
+
+
364 size_t get_ts_index_for_time(const time_t &epoch_time) override {
+
365 // TODO: come back and implement if actually necessary for this type; for now don't use
+
366 throw std::runtime_error("Bmi_Multi_Formulation does not yet implement get_ts_index_for_time");
+
367 }
+
+
368
+
+ +
391 {
+
392 std::string output_name = selector.get_variable_name();
+
393 time_t init_time = selector.get_init_time();
+
394 long duration_s = selector.get_duration_secs();
+
395 std::string output_units = selector.get_output_units();
+
396
+
397 // If not found ...
+
398 if (availableData.empty() || availableData.find(output_name) == availableData.end()) {
+
399 throw std::runtime_error(get_formulation_type() + " cannot get output value for unknown " + output_name + SOURCE_LOC);
+
400 }
+
401 return availableData[output_name]->get_value(CatchmentAggrDataSelector(this->get_catchment_id(),output_name, init_time, duration_s, output_units), m);
+
402 }
+
+
403
+
+
404 std::vector<double> get_values(const CatchmentAggrDataSelector& selector, data_access::ReSampleMethod m) override
+
405 {
+
406 std::string output_name = selector.get_variable_name();
+
407 time_t init_time = selector.get_init_time();
+
408 long duration_s = selector.get_duration_secs();
+
409 std::string output_units = selector.get_output_units();
+
410
+
411 if (availableData.empty() || availableData.find(output_name) == availableData.end()) {
+
412 throw std::runtime_error(get_formulation_type() + " cannot get output values for unknown " + output_name + SOURCE_LOC);
+
413 }
+
414 return availableData[output_name]->get_values(CatchmentAggrDataSelector(this->get_catchment_id(),output_name, init_time, duration_s, output_units), m);
+
415 }
+
+
416
+
417 bool is_bmi_input_variable(const std::string &var_name) override;
+
418
+
424 bool is_bmi_model_time_step_fixed() override;
+
425
+
426 bool is_bmi_output_variable(const std::string &var_name) override;
+
427
+
428 bool is_bmi_using_forcing_file() const override;
+
429
+
435 bool is_model_initialized() override;
+
436
+
+
455 bool is_property_sum_over_time_step(const std::string &name) override {
+
456 if (availableData.empty() || availableData.find(name) == availableData.end()) {
+
457 throw std::runtime_error(
+
458 get_formulation_type() + " cannot get whether unknown property " + name + " is summation");
+
459 }
+
460 return availableData[name]->is_property_sum_over_time_step(name);
+
461 }
+
+
462
+
469 bool is_time_step_beyond_end_time(time_step_t t_index);
+
470
+
+ + +
478 }
+
+
479
+
+
488 inline void set_index_for_primary_module(int index) {
+
489 if (index < modules.size()) {
+
490 primary_module_index = index;
+
491 }
+
492 }
+
+
493
+
+ +
498 // variable already checked
+ +
500 return;
+
501 }
+
502
+
503 // get bmi_multi global output variable names
+
504 const std::vector<std::string> &output_var_names = get_output_variable_names();
+
505
+
506 // store variable names in avaialbleData in the valid output variable name list
+
507 std::vector<std::string> available_var_names;
+
508 std::string var_name;
+
509 for(std::map<std::string,std::shared_ptr<data_access::GenericDataProvider>>::iterator iter = availableData.begin(); iter != availableData.end(); ++iter)
+
510 {
+
511 var_name = iter->first;
+
512 available_var_names.push_back(var_name);
+
513 }
+
514
+
515 // check if an output variable listed in the bmi_multi global is a valid variable
+
516 for (int i = 0; i < output_var_names.size(); ++i) {
+
517 auto it = std::find(available_var_names.begin(), available_var_names.end(), output_var_names[i]);
+
518 if (it == available_var_names.end()) {
+
519 throw std::runtime_error(output_var_names[i] + " does not exist in the output name list" + SOURCE_LOC);
+
520 }
+
521 }
+
522 }
+
+
523
+
524 protected:
+
525
+
532 void create_multi_formulation(geojson::PropertyMap properties, bool needs_param_validation);
+
533
+
534 template<class T>
+
+
535 double get_module_var_value_as_double(const std::string &var_name, std::shared_ptr<Bmi_Formulation> mod) {
+
536 std::shared_ptr<T> module = std::static_pointer_cast<T>(mod);
+
537 return module->get_var_value_as_double(var_name);
+
538 }
+
+
539
+
+
550 double get_var_value_as_double(const std::string &var_name) override {
+
551 return get_var_value_as_double(0, var_name);
+
552 }
+
+
553
+
+
578 double get_var_value_as_double(const int& index, const std::string& var_name) override {
+
579 auto data_provider_iter = availableData.find(var_name);
+
580 if (data_provider_iter == availableData.end()) {
+ +
582 "Multi BMI formulation can't find correct nested module for BMI variable " + var_name + SOURCE_LOC);
+
583 }
+
584 // Otherwise, we have a provider, and we can cast it based on the documented assumptions
+
585 try {
+
586 std::shared_ptr <data_access::GenericDataProvider> nested_module =
+
587 std::dynamic_pointer_cast<data_access::GenericDataProvider>(data_provider_iter->second);
+
588 long nested_module_time = nested_module->get_data_start_time() + ( this->get_model_current_time() - this->get_model_start_time() );
+
589 auto selector = CatchmentAggrDataSelector(this->get_catchment_id(),var_name,nested_module_time,this->record_duration(),"1");
+
590 //TODO: After merge PR#405, try re-adding support for index
+
591 return nested_module->get_value(selector);
+
592 }
+
593 // If there was any problem with the cast and extraction of the value, throw runtime error
+
594 catch (std::exception &e) {
+
595 throw std::runtime_error("Multi BMI formulation can't use associated data provider as a nested module"
+
596 " when attempting to get values of BMI variable " + var_name + SOURCE_LOC);
+
597 // TODO: look at adjusting defs to move this function up in class hierarchy (or at least add TODO there)
+
598 }
+
599 }
+
+
600
+
+ +
611 for (int d = 0; d < deferredProviders.size(); ++d) {
+
612 std::shared_ptr<data_access::OptionalWrappedDataProvider> &deferredProvider = deferredProviders[d];
+
613 // Skip doing anything for any deferred provider that already has its backing provider set
+
614 if (deferredProvider->isWrappedProviderSet())
+
615 continue;
+
616
+
617 // TODO: improve this later; since defaults can be used, it is technically possible to grab something
+
618 // valid when something more appropriate would later be available
+
619 // Iterate through available data providers and set association once a sufficient one is found
+
620 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>>::iterator avail_it;
+
621 for (avail_it = availableData.begin(); avail_it != availableData.end(); avail_it++) {
+
622 // If this satisfies everything this deferred provider needs to provide, and thus can be/was set ...
+
623 if (deferredProvider->setWrappedProvider(avail_it->second.get())) {
+
624 break;
+
625 }
+
626 }
+
627
+
628 // If none of the available data providers could be used for this deferred one, throw exception
+
629 if (!deferredProvider->isWrappedProviderSet()) {
+
630 // TODO: this probably needs to be some kind of custom configuration exception
+
631 std::string msg = "Multi BMI formulation cannot be created from config: cannot find available data "
+
632 "provider to satisfy set of deferred provisions for nested module at index "
+
633 + std::to_string(deferredProviderModuleIndices[d]) + ": {";
+
634 // There must always be at least 1; get manually to help with formatting
+
635 msg += deferredProvider->get_available_variable_names()[0];
+
636 // And here make sure to start at 1 instead of 0
+
637 for (int i = 1; i < deferredProvider->get_available_variable_names().size(); ++i)
+
638 msg += ", " + deferredProvider->get_available_variable_names()[i];
+
639 msg += "}";
+ +
641 }
+
642 }
+
643 }
+
+
644
+
660 template<class T>
+
+
661 std::shared_ptr<T> init_nested_module(int mod_index, std::string identifier, geojson::PropertyMap properties) {
+
662 std::shared_ptr<data_access::GenericDataProvider> wfp = std::make_shared<data_access::WrappedDataProvider>(this);
+
663 std::shared_ptr<T> mod = std::make_shared<T>(identifier, wfp, output);
+
664
+
665 // Since this is a nested formulation, support usage of the '{{id}}' syntax for init config file paths.
+
666 Catchment_Formulation::config_pattern_substitution(properties, BMI_REALIZATION_CFG_PARAM_REQ__INIT_CONFIG,
+
667 "{{id}}", id);
+
668
+
669 // Call create_formulation to perform the rest of the typical initialization steps for the formulation.
+
670 mod->create_formulation(properties);
+
671
+
672 // Set this up for placing in the module_variable_maps member variable
+
673 std::shared_ptr<std::map<std::string, std::string>> var_aliases;
+
674 var_aliases = std::make_shared<std::map<std::string, std::string>>(std::map<std::string, std::string>());
+
675 for (const std::string &var_name : mod->get_bmi_input_variables()) {
+
676 std::string framework_alias = mod->get_config_mapped_variable_name(var_name);
+
677 (*var_aliases)[framework_alias] = var_name;
+
678 // If framework_name is not yet in collection from which we have available data sources ...
+
679 if (availableData.count(framework_alias) != 1) {
+
680 setup_nested_deferred_provider(var_name, framework_alias, mod, mod_index);
+
681 }
+
682 else {
+
683 mod->input_forcing_providers[var_name] = availableData[framework_alias];
+
684 mod->input_forcing_providers[framework_alias] = availableData[framework_alias];
+
685 }
+
686 }
+
687
+
688 // Also add the output variable aliases
+
689 for (const std::string &var_name : mod->get_bmi_output_variables()) {
+
690 std::string framework_alias = mod->get_config_mapped_variable_name(var_name);
+
691 (*var_aliases)[framework_alias] = var_name;
+
692 if (availableData.count(framework_alias) > 0) {
+
693 throw std::runtime_error(
+
694 "Multi BMI cannot be created with module " + mod->get_model_type_name() +
+
695 " with output variable " + framework_alias +
+
696 (var_name == framework_alias ? "" : " (an alias of BMI variable " + var_name + ")") +
+
697 " because a previous module is using this output variable name/alias.");
+
698 }
+
699 availableData[framework_alias] = mod;
+
700 }
+
701 module_variable_maps[mod_index] = var_aliases;
+
702 return mod;
+
703 }
+
+
704
+
713 std::map<std::string, std::shared_ptr<data_access::GenericDataProvider>> availableData;
+
714
+
715 private:
+
716
+
732 template<class T>
+
+
733 void setup_nested_deferred_provider(const std::string &bmi_input_var_name,
+
734 const std::string &framework_output_name,
+
735 std::shared_ptr<T> mod,
+
736 int mod_index) {
+
737 // TODO: probably don't actually need bmi_input_var_name, and just can deal with framework_output_name
+
738 // Create deferred, optional provider for providing this
+
739 // Only include BMI variable name, as that's what'll be visible when associating to backing provider
+
740 // It's "deferred" in that we'll set the backing later.
+
741 // It's "optional" in that it waits to use backing provider, using the default some number of times
+
742 std::shared_ptr<data_access::OptionalWrappedDataProvider> provider;
+
743 // TODO: make sure only alias is needed
+
744 auto defs_it = default_output_values.find(framework_output_name);
+
745 if (defs_it != default_output_values.end()) {
+
746 // TODO: consider also reading wait count from config
+
747 provider = std::make_shared<data_access::OptionalWrappedDataProvider>(framework_output_name, defs_it->second, 1);
+
748 }
+
749 else {
+
750 provider = std::make_shared<data_access::OptionalWrappedDataProvider>(framework_output_name);
+
751 }
+
752
+
753 // Add deferred to collection and module index to collection
+
754 deferredProviders.push_back(provider);
+
755 deferredProviderModuleIndices.push_back(mod_index);
+
756 // Assign as provider within module
+
757 // TODO: per TODO at top, probably can replace bmi_input_var_name here with framework_output_name
+
758 mod->input_forcing_providers[bmi_input_var_name] = provider;
+
759 }
+
+
760
+
762 std::vector<std::string> available_forcings;
+
766 std::map<std::string, double> default_output_values;
+
775 std::vector<std::shared_ptr<data_access::OptionalWrappedDataProvider>> deferredProviders;
+
776
+ + +
790 std::vector<nested_module_ptr> modules;
+
791 std::vector<std::string> module_types;
+
795 // TODO: confirm that we actually need this for something
+
796 std::vector<std::shared_ptr<std::map<std::string, std::string>>> module_variable_maps;
+ + +
801
+ +
803 friend class ::Bmi_Cpp_Multi_Array_Test;
+
804
+
805 };
+
+
806}
+
807
+
808#endif //NGEN_BMI_MULTI_FORMULATION_HPP
This class is intended to be the virtual base for all data selectors used with the DataProvider API.
Definition DataProviderSelectors.hpp:13
std::string get_variable_name() const
Get the variable name for this selector.
Definition DataProviderSelectors.hpp:50
long get_duration_secs() const
Get the duration in seconds that is requested by this selector.
Definition DataProviderSelectors.hpp:64
@@ -582,65 +583,65 @@
Custom exception indicating a problem when integrating with some external component.
Definition ExternalIntegrationException.hpp:14
Abstraction of formulation with backing model object(s) that implements the BMI.
Definition Bmi_Formulation.hpp:49
const std::vector< std::string > & get_output_variable_names() const
Get the names of variables in formulation output.
Definition Bmi_Formulation.hpp:173
-
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:24
-
bool is_time_step_beyond_end_time(time_step_t t_index)
Get whether this time step goes beyond this formulations (i.e., any of it's modules') end time.
Definition Bmi_Multi_Formulation.cpp:438
-
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Multi_Formulation.cpp:409
-
std::shared_ptr< T > init_nested_module(int mod_index, std::string identifier, geojson::PropertyMap properties)
Initialize a nested formulation from the given properties and update multi formulation metadata.
Definition Bmi_Multi_Formulation.hpp:660
-
double get_response(time_step_t t_index, time_step_t t_delta) override
Execute the backing model formulation for the given time step, where it is of the specified size,...
Definition Bmi_Multi_Formulation.cpp:323
-
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_Multi_Formulation.hpp:549
-
std::vector< nested_module_ptr > modules
The nested BMI modules composing this multi-module formulation, in their order of execution.
Definition Bmi_Multi_Formulation.hpp:789
-
std::string get_output_line_for_timestep(int timestep, std::string delimiter) override
Get a formatted line of output values for the given time step as a delimited string.
Definition Bmi_Multi_Formulation.cpp:287
-
int next_time_step_index
Index value (0-based) of the time step that will be processed by the next update of the model.
Definition Bmi_Multi_Formulation.hpp:797
-
const std::string & get_config_mapped_variable_name(const std::string &model_var_name) override
When possible, translate a variable name for a BMI model to an internally recognized name.
Definition Bmi_Multi_Formulation.cpp:215
-
Bmi_Formulation nested_module_type
Definition Bmi_Multi_Formulation.hpp:28
-
const time_t & get_bmi_model_start_time_forcing_offset_s() override
Definition Bmi_Multi_Formulation.cpp:193
-
bool is_out_vars_from_last_mod
Whether the Bmi_Formulation::output_variable_names value is just the analogous value from this instan...
Definition Bmi_Multi_Formulation.hpp:787
-
std::vector< double > get_values(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the values of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Multi_Formulation.hpp:403
-
void set_index_for_primary_module(int index)
Set the index of the primary module.
Definition Bmi_Multi_Formulation.hpp:487
-
time_t get_variable_time_end(const std::string &variable_name)
Get the exclusive ending of the period of time over which this instance can provide data for this for...
Definition Bmi_Multi_Formulation.hpp:277
-
long get_data_stop_time() override
Get the exclusive ending of the period of time over which this instance can provide data for this for...
Definition Bmi_Multi_Formulation.hpp:262
-
bool is_bmi_using_forcing_file() const override
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Multi_Formulation.cpp:422
-
const std::vector< std::string > get_bmi_output_variables() override
Get the output variables of the last nested BMI model.
Definition Bmi_Multi_Formulation.hpp:138
-
void check_output_var_names()
Check that the output variable names in the global bmi_multi are valid names.
Definition Bmi_Multi_Formulation.hpp:496
-
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Multi_Formulation.hpp:58
-
void init_deferred_associations()
Initialize the deferred associations with the providers in deferredProviders.
Definition Bmi_Multi_Formulation.hpp:609
-
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Multi_Formulation.cpp:418
-
virtual ~Bmi_Multi_Formulation()
Definition Bmi_Multi_Formulation.hpp:42
-
std::vector< std::string > module_types
Definition Bmi_Multi_Formulation.hpp:790
-
const std::string & get_forcing_file_path() const override
Definition Bmi_Multi_Formulation.cpp:283
-
std::vector< std::shared_ptr< data_access::OptionalWrappedDataProvider > > deferredProviders
A collection of wrappers to nested formulations providing some output to an earlier nested formulatio...
Definition Bmi_Multi_Formulation.hpp:774
-
long record_duration() override
Return the stride in the time dimension.
Definition Bmi_Multi_Formulation.hpp:291
-
double get_var_value_as_double(const int &index, const std::string &var_name) override
Get value for some BMI model variable at a specific index.
Definition Bmi_Multi_Formulation.hpp:577
-
void create_multi_formulation(geojson::PropertyMap properties, bool needs_param_validation)
Creating a multi-BMI-module formulation from NGen config.
Definition Bmi_Multi_Formulation.cpp:10
-
void create_formulation(geojson::PropertyMap properties) override
Definition Bmi_Multi_Formulation.hpp:84
-
bool is_property_sum_over_time_step(const std::string &name) override
Get whether a property's per-time-step values are each an aggregate sum over the entire time step.
Definition Bmi_Multi_Formulation.hpp:454
-
bool is_bmi_model_time_step_fixed() override
Test whether all backing models have fixed time step size.
Definition Bmi_Multi_Formulation.cpp:413
-
void setup_nested_deferred_provider(const std::string &bmi_input_var_name, const std::string &framework_output_name, std::shared_ptr< T > mod, int mod_index)
Setup a deferred provider for a nested module, tracking the class as needed.
Definition Bmi_Multi_Formulation.hpp:732
-
const std::vector< std::string > get_bmi_input_variables() override
Get the input variables of the first nested BMI model.
Definition Bmi_Multi_Formulation.hpp:127
-
friend Bmi_Multi_Formulation_Test
Definition Bmi_Multi_Formulation.hpp:801
-
std::vector< std::shared_ptr< std::map< std::string, std::string > > > module_variable_maps
Per-module maps (ordered as in modules) of configuration-mapped names to BMI variable names.
Definition Bmi_Multi_Formulation.hpp:795
-
std::vector< std::string > available_forcings
The set of available "forcings" (output variables, plus their mapped aliases) this instance can provi...
Definition Bmi_Multi_Formulation.hpp:761
-
bool is_model_initialized() override
Test whether all backing models have been initialize using the BMI standard Initialize function.
Definition Bmi_Multi_Formulation.cpp:427
-
std::map< std::string, std::shared_ptr< data_access::GenericDataProvider > > availableData
A mapping of data properties to their providers.
Definition Bmi_Multi_Formulation.hpp:712
-
std::vector< int > deferredProviderModuleIndices
The module indices for the modules associated with each item in deferredProviders.
Definition Bmi_Multi_Formulation.hpp:782
-
const double get_model_start_time()
Get the end time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:342
-
const double get_model_end_time() override
Get the end time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:333
-
int primary_module_index
The index of the "primary" nested module, used when functionality is deferred to a particular module'...
Definition Bmi_Multi_Formulation.hpp:799
-
int get_index_for_primary_module()
Get the index of the primary module.
Definition Bmi_Multi_Formulation.hpp:475
-
time_t convert_model_time(const double &model_time, int module_index)
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Multi_Formulation.hpp:75
-
const double get_model_current_time() override
Get the current time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:324
-
Bmi_Multi_Formulation(std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing_provider, utils::StreamHandler output_stream)
Minimal constructor for objects initialize using the Formulation_Manager and subsequent calls to crea...
Definition Bmi_Multi_Formulation.hpp:39
-
const bool & get_allow_model_exceed_end_time() const override
Get whether a model may perform updates beyond its end_time.
Definition Bmi_Multi_Formulation.cpp:160
-
void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) override
Definition Bmi_Multi_Formulation.hpp:79
-
size_t get_ts_index_for_time(const time_t &epoch_time) override
Get the index of the forcing time step that contains the given point in time.
Definition Bmi_Multi_Formulation.hpp:363
-
long get_data_start_time() override
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Multi_Formulation.hpp:223
-
boost::span< const std::string > get_available_variable_names() override
Get the collection of forcing output property names this instance can provide.
Definition Bmi_Multi_Formulation.cpp:182
-
std::string get_formulation_type() override
Definition Bmi_Multi_Formulation.hpp:315
-
time_t get_variable_time_begin(const std::string &variable_name)
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Multi_Formulation.hpp:238
-
std::shared_ptr< nested_module_type > nested_module_ptr
Definition Bmi_Multi_Formulation.hpp:29
-
double get_module_var_value_as_double(const std::string &var_name, std::shared_ptr< Bmi_Formulation > mod)
Definition Bmi_Multi_Formulation.hpp:534
-
std::map< std::string, double > default_output_values
Any configured default values for outputs, keyed by framework alias (or var name if this is globally ...
Definition Bmi_Multi_Formulation.hpp:765
-
double get_value(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the value of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Multi_Formulation.hpp:389
+
Abstraction of a formulation with multiple backing model object that implements the BMI.
Definition Bmi_Multi_Formulation.hpp:25
+
bool is_time_step_beyond_end_time(time_step_t t_index)
Get whether this time step goes beyond this formulations (i.e., any of it's modules') end time.
Definition Bmi_Multi_Formulation.cpp:443
+
bool is_bmi_input_variable(const std::string &var_name) override
Definition Bmi_Multi_Formulation.cpp:414
+
std::shared_ptr< T > init_nested_module(int mod_index, std::string identifier, geojson::PropertyMap properties)
Initialize a nested formulation from the given properties and update multi formulation metadata.
Definition Bmi_Multi_Formulation.hpp:661
+
double get_response(time_step_t t_index, time_step_t t_delta) override
Execute the backing model formulation for the given time step, where it is of the specified size,...
Definition Bmi_Multi_Formulation.cpp:328
+
double get_var_value_as_double(const std::string &var_name) override
Get value for some BMI model variable.
Definition Bmi_Multi_Formulation.hpp:550
+
std::vector< nested_module_ptr > modules
The nested BMI modules composing this multi-module formulation, in their order of execution.
Definition Bmi_Multi_Formulation.hpp:790
+
std::string get_output_line_for_timestep(int timestep, std::string delimiter) override
Get a formatted line of output values for the given time step as a delimited string.
Definition Bmi_Multi_Formulation.cpp:292
+
int next_time_step_index
Index value (0-based) of the time step that will be processed by the next update of the model.
Definition Bmi_Multi_Formulation.hpp:798
+
const std::string & get_config_mapped_variable_name(const std::string &model_var_name) override
When possible, translate a variable name for a BMI model to an internally recognized name.
Definition Bmi_Multi_Formulation.cpp:220
+
Bmi_Formulation nested_module_type
Definition Bmi_Multi_Formulation.hpp:29
+
const time_t & get_bmi_model_start_time_forcing_offset_s() override
Definition Bmi_Multi_Formulation.cpp:198
+
bool is_out_vars_from_last_mod
Whether the Bmi_Formulation::output_variable_names value is just the analogous value from this instan...
Definition Bmi_Multi_Formulation.hpp:788
+
std::vector< double > get_values(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the values of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Multi_Formulation.hpp:404
+
void set_index_for_primary_module(int index)
Set the index of the primary module.
Definition Bmi_Multi_Formulation.hpp:488
+
time_t get_variable_time_end(const std::string &variable_name)
Get the exclusive ending of the period of time over which this instance can provide data for this for...
Definition Bmi_Multi_Formulation.hpp:278
+
long get_data_stop_time() override
Get the exclusive ending of the period of time over which this instance can provide data for this for...
Definition Bmi_Multi_Formulation.hpp:263
+
bool is_bmi_using_forcing_file() const override
Whether the backing model uses/reads the forcing file directly for getting input data.
Definition Bmi_Multi_Formulation.cpp:427
+
const std::vector< std::string > get_bmi_output_variables() override
Get the output variables of the last nested BMI model.
Definition Bmi_Multi_Formulation.hpp:139
+
void check_output_var_names()
Check that the output variable names in the global bmi_multi are valid names.
Definition Bmi_Multi_Formulation.hpp:497
+
time_t convert_model_time(const double &model_time) override
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Multi_Formulation.hpp:59
+
void init_deferred_associations()
Initialize the deferred associations with the providers in deferredProviders.
Definition Bmi_Multi_Formulation.hpp:610
+
bool is_bmi_output_variable(const std::string &var_name) override
Definition Bmi_Multi_Formulation.cpp:423
+
virtual ~Bmi_Multi_Formulation()
Definition Bmi_Multi_Formulation.hpp:43
+
std::vector< std::string > module_types
Definition Bmi_Multi_Formulation.hpp:791
+
const std::string & get_forcing_file_path() const override
Definition Bmi_Multi_Formulation.cpp:288
+
std::vector< std::shared_ptr< data_access::OptionalWrappedDataProvider > > deferredProviders
A collection of wrappers to nested formulations providing some output to an earlier nested formulatio...
Definition Bmi_Multi_Formulation.hpp:775
+
long record_duration() override
Return the stride in the time dimension.
Definition Bmi_Multi_Formulation.hpp:292
+
double get_var_value_as_double(const int &index, const std::string &var_name) override
Get value for some BMI model variable at a specific index.
Definition Bmi_Multi_Formulation.hpp:578
+
void create_multi_formulation(geojson::PropertyMap properties, bool needs_param_validation)
Creating a multi-BMI-module formulation from NGen config.
Definition Bmi_Multi_Formulation.cpp:15
+
void create_formulation(geojson::PropertyMap properties) override
Definition Bmi_Multi_Formulation.hpp:85
+
bool is_property_sum_over_time_step(const std::string &name) override
Get whether a property's per-time-step values are each an aggregate sum over the entire time step.
Definition Bmi_Multi_Formulation.hpp:455
+
bool is_bmi_model_time_step_fixed() override
Test whether all backing models have fixed time step size.
Definition Bmi_Multi_Formulation.cpp:418
+
void setup_nested_deferred_provider(const std::string &bmi_input_var_name, const std::string &framework_output_name, std::shared_ptr< T > mod, int mod_index)
Setup a deferred provider for a nested module, tracking the class as needed.
Definition Bmi_Multi_Formulation.hpp:733
+
const std::vector< std::string > get_bmi_input_variables() override
Get the input variables of the first nested BMI model.
Definition Bmi_Multi_Formulation.hpp:128
+
friend Bmi_Multi_Formulation_Test
Definition Bmi_Multi_Formulation.hpp:802
+
std::vector< std::shared_ptr< std::map< std::string, std::string > > > module_variable_maps
Per-module maps (ordered as in modules) of configuration-mapped names to BMI variable names.
Definition Bmi_Multi_Formulation.hpp:796
+
std::vector< std::string > available_forcings
The set of available "forcings" (output variables, plus their mapped aliases) this instance can provi...
Definition Bmi_Multi_Formulation.hpp:762
+
bool is_model_initialized() override
Test whether all backing models have been initialize using the BMI standard Initialize function.
Definition Bmi_Multi_Formulation.cpp:432
+
std::map< std::string, std::shared_ptr< data_access::GenericDataProvider > > availableData
A mapping of data properties to their providers.
Definition Bmi_Multi_Formulation.hpp:713
+
std::vector< int > deferredProviderModuleIndices
The module indices for the modules associated with each item in deferredProviders.
Definition Bmi_Multi_Formulation.hpp:783
+
const double get_model_start_time()
Get the end time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:343
+
const double get_model_end_time() override
Get the end time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:334
+
int primary_module_index
The index of the "primary" nested module, used when functionality is deferred to a particular module'...
Definition Bmi_Multi_Formulation.hpp:800
+
int get_index_for_primary_module()
Get the index of the primary module.
Definition Bmi_Multi_Formulation.hpp:476
+
time_t convert_model_time(const double &model_time, int module_index)
Convert a time value from the model to an epoch time in seconds.
Definition Bmi_Multi_Formulation.hpp:76
+
const double get_model_current_time() override
Get the current time for the primary nested BMI model in its native format and units.
Definition Bmi_Multi_Formulation.hpp:325
+
Bmi_Multi_Formulation(std::string id, std::shared_ptr< data_access::GenericDataProvider > forcing_provider, utils::StreamHandler output_stream)
Minimal constructor for objects initialize using the Formulation_Manager and subsequent calls to crea...
Definition Bmi_Multi_Formulation.hpp:40
+
const bool & get_allow_model_exceed_end_time() const override
Get whether a model may perform updates beyond its end_time.
Definition Bmi_Multi_Formulation.cpp:165
+
void create_formulation(boost::property_tree::ptree &config, geojson::PropertyMap *global=nullptr) override
Definition Bmi_Multi_Formulation.hpp:80
+
size_t get_ts_index_for_time(const time_t &epoch_time) override
Get the index of the forcing time step that contains the given point in time.
Definition Bmi_Multi_Formulation.hpp:364
+
long get_data_start_time() override
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Multi_Formulation.hpp:224
+
boost::span< const std::string > get_available_variable_names() override
Get the collection of forcing output property names this instance can provide.
Definition Bmi_Multi_Formulation.cpp:187
+
std::string get_formulation_type() override
Definition Bmi_Multi_Formulation.hpp:316
+
time_t get_variable_time_begin(const std::string &variable_name)
Get the inclusive beginning of the period of time over which this instance can provide data for this ...
Definition Bmi_Multi_Formulation.hpp:239
+
std::shared_ptr< nested_module_type > nested_module_ptr
Definition Bmi_Multi_Formulation.hpp:30
+
double get_module_var_value_as_double(const std::string &var_name, std::shared_ptr< Bmi_Formulation > mod)
Definition Bmi_Multi_Formulation.hpp:535
+
std::map< std::string, double > default_output_values
Any configured default values for outputs, keyed by framework alias (or var name if this is globally ...
Definition Bmi_Multi_Formulation.hpp:766
+
double get_value(const CatchmentAggrDataSelector &selector, data_access::ReSampleMethod m) override
Get the value of a forcing property for an arbitrary time period, converting units if needed.
Definition Bmi_Multi_Formulation.hpp:390
static void config_pattern_substitution(geojson::PropertyMap &properties, const std::string &key, const std::string &pattern, const std::string &replacement)
Perform in-place substitution on the given config property item, if the item and the pattern are pres...
Definition Catchment_Formulation.hpp:38
std::string get_catchment_id() override
Definition Catchment_Formulation.hpp:95
Custom exception indicating a problem when integrating with the provided realization configuration.
Definition ConfigurationException.hpp:13
@@ -656,7 +657,7 @@ diff --git a/_bmi___py___adapter_8hpp_source.html b/_bmi___py___adapter_8hpp_source.html index f5b39433d9..432f17e928 100644 --- a/_bmi___py___adapter_8hpp_source.html +++ b/_bmi___py___adapter_8hpp_source.html @@ -663,7 +663,7 @@ diff --git a/_bmi___py___formulation_8hpp_source.html b/_bmi___py___formulation_8hpp_source.html index 5ccfc756bf..0b6676e0fc 100644 --- a/_bmi___py___formulation_8hpp_source.html +++ b/_bmi___py___formulation_8hpp_source.html @@ -116,7 +116,7 @@
17
18namespace realization {
19
-
20 class Bmi_Py_Formulation : public Bmi_Module_Formulation<models::bmi::Bmi_Py_Adapter> {
+
20 class Bmi_Py_Formulation : public Bmi_Module_Formulation {
21
22 public:
23
@@ -128,44 +128,37 @@
29
30 std::string get_formulation_type() override;
31
-
54 std::string get_output_line_for_timestep(int timestep, std::string delimiter) override;
-
55
-
90 double get_response(time_step_t t_index, time_step_t t_delta) override;
-
91
-
92 bool is_bmi_input_variable(const std::string &var_name) override;
+
66 double get_response(time_step_t t_index, time_step_t t_delta) override;
+
67
+
68 bool is_bmi_input_variable(const std::string &var_name) override;
+
69
+
70 bool is_bmi_output_variable(const std::string &var_name) override;
+
71
+
72 protected:
+
73
+
74 std::shared_ptr<models::bmi::Bmi_Adapter> construct_model(const geojson::PropertyMap &properties) override;
+
75
+
76 time_t convert_model_time(const double &model_time) override;
+
77
+
78 double get_var_value_as_double(const std::string &var_name) override;
+
79
+
80 double get_var_value_as_double(const int &index, const std::string &var_name) override;
+
81
+
92 bool is_model_initialized() override;
93
-
94 bool is_bmi_output_variable(const std::string &var_name) override;
+
94 friend class Bmi_Multi_Formulation;
95
-
96 protected:
-
97
-
98 std::shared_ptr<models::bmi::Bmi_Py_Adapter> construct_model(const geojson::PropertyMap &properties) override;
-
99
-
100 time_t convert_model_time(const double &model_time) override;
+
96 // Unit test access
+
97 friend class ::Bmi_Formulation_Test;
+
98 friend class ::Bmi_Py_Formulation_Test;
+
99 friend class ::Bmi_Multi_Formulation_Test;
+
100 };
101
-
102 double get_var_value_as_double(const std::string &var_name) override;
+
102}
103
-
104 double get_var_value_as_double(const int &index, const std::string &var_name) override;
+
104#endif //ACTIVATE_PYTHON
105
-
116 bool is_model_initialized() override;
-
117
-
118 friend class Bmi_Multi_Formulation;
-
119
-
120 // Unit test access
-
121 friend class ::Bmi_Formulation_Test;
-
122 friend class ::Bmi_Py_Formulation_Test;
-
123 friend class ::Bmi_Multi_Formulation_Test;
-
124
-
125 private:
-
126
-
146 int next_time_step_index = 0;
-
147
-
148 };
-
149
-
150}
-
151
-
152#endif //ACTIVATE_PYTHON
-
153
-
154#endif //NGEN_BMI_PY_FORMULATION_H
+
106#endif //NGEN_BMI_PY_FORMULATION_H
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition Bmi_C_Formulation.hpp:11
@@ -175,7 +168,7 @@ diff --git a/_c_s_v___reader_8h_source.html b/_c_s_v___reader_8h_source.html index fc9c572f8c..ba24edace8 100644 --- a/_c_s_v___reader_8h_source.html +++ b/_c_s_v___reader_8h_source.html @@ -183,7 +183,7 @@ diff --git a/_catchment___formulation_8hpp_source.html b/_catchment___formulation_8hpp_source.html index 88fc900ca1..60acea2742 100644 --- a/_catchment___formulation_8hpp_source.html +++ b/_catchment___formulation_8hpp_source.html @@ -214,7 +214,7 @@ diff --git a/_collection_feature_8hpp_source.html b/_collection_feature_8hpp_source.html index 432f48dab0..0163ca78ef 100644 --- a/_collection_feature_8hpp_source.html +++ b/_collection_feature_8hpp_source.html @@ -393,7 +393,7 @@ diff --git a/_configuration_exception_8hpp_source.html b/_configuration_exception_8hpp_source.html index 55b9641786..74e05671b2 100644 --- a/_configuration_exception_8hpp_source.html +++ b/_configuration_exception_8hpp_source.html @@ -150,7 +150,7 @@ diff --git a/_constants_8h_source.html b/_constants_8h_source.html index 90db50a9cd..05a2a0d9a7 100644 --- a/_constants_8h_source.html +++ b/_constants_8h_source.html @@ -115,7 +115,7 @@ diff --git a/_csv_per_feature_forcing_provider_8hpp_source.html b/_csv_per_feature_forcing_provider_8hpp_source.html index 691d7a3917..cdbd3fead4 100644 --- a/_csv_per_feature_forcing_provider_8hpp_source.html +++ b/_csv_per_feature_forcing_provider_8hpp_source.html @@ -519,7 +519,7 @@ diff --git a/_data_provider_8hpp_source.html b/_data_provider_8hpp_source.html index f1cccd2b76..9aa4bcacdb 100644 --- a/_data_provider_8hpp_source.html +++ b/_data_provider_8hpp_source.html @@ -170,7 +170,7 @@ diff --git a/_data_provider_selectors_8hpp_source.html b/_data_provider_selectors_8hpp_source.html index 02fd6acdd3..ea368cd681 100644 --- a/_data_provider_selectors_8hpp_source.html +++ b/_data_provider_selectors_8hpp_source.html @@ -253,7 +253,7 @@ diff --git a/_deferred_wrapped_provider_8hpp_source.html b/_deferred_wrapped_provider_8hpp_source.html index fe18a14aee..d7af081ded 100644 --- a/_deferred_wrapped_provider_8hpp_source.html +++ b/_deferred_wrapped_provider_8hpp_source.html @@ -216,7 +216,7 @@ diff --git a/_endian_copy_8hpp_source.html b/_endian_copy_8hpp_source.html index 4303a27278..54b2e6f6ce 100644 --- a/_endian_copy_8hpp_source.html +++ b/_endian_copy_8hpp_source.html @@ -156,7 +156,7 @@ diff --git a/_external_integration_exception_8hpp_source.html b/_external_integration_exception_8hpp_source.html index 4399cf305d..9971015317 100644 --- a/_external_integration_exception_8hpp_source.html +++ b/_external_integration_exception_8hpp_source.html @@ -150,7 +150,7 @@ diff --git a/_feature_base_8hpp_source.html b/_feature_base_8hpp_source.html index d715e4c8d8..6e00d8999a 100644 --- a/_feature_base_8hpp_source.html +++ b/_feature_base_8hpp_source.html @@ -883,7 +883,7 @@ diff --git a/_feature_builder_8hpp_source.html b/_feature_builder_8hpp_source.html index 0a49a09dab..257ce6c4f9 100644 --- a/_feature_builder_8hpp_source.html +++ b/_feature_builder_8hpp_source.html @@ -603,7 +603,7 @@ diff --git a/_feature_collection_8hpp_source.html b/_feature_collection_8hpp_source.html index 1001b69bed..d807b4cb02 100644 --- a/_feature_collection_8hpp_source.html +++ b/_feature_collection_8hpp_source.html @@ -297,7 +297,7 @@ diff --git a/_feature_visitor_8hpp_source.html b/_feature_visitor_8hpp_source.html index 08438c3e08..49ca10da27 100644 --- a/_feature_visitor_8hpp_source.html +++ b/_feature_visitor_8hpp_source.html @@ -145,7 +145,7 @@ diff --git a/_features_8hpp_source.html b/_features_8hpp_source.html index 61d3bf59eb..cbc5c1971f 100644 --- a/_features_8hpp_source.html +++ b/_features_8hpp_source.html @@ -116,7 +116,7 @@ diff --git a/_file_checker_8h_source.html b/_file_checker_8h_source.html index 5901737cd2..6b3bb48e00 100644 --- a/_file_checker_8h_source.html +++ b/_file_checker_8h_source.html @@ -236,7 +236,7 @@ diff --git a/_file_stream_handler_8hpp_source.html b/_file_stream_handler_8hpp_source.html index 5b57900900..b455dd878e 100644 --- a/_file_stream_handler_8hpp_source.html +++ b/_file_stream_handler_8hpp_source.html @@ -137,7 +137,7 @@ diff --git a/_formulation___constructors_8hpp_source.html b/_formulation___constructors_8hpp_source.html index c6a7be4342..669265f1f7 100644 --- a/_formulation___constructors_8hpp_source.html +++ b/_formulation___constructors_8hpp_source.html @@ -108,119 +108,91 @@
9#include <boost/optional.hpp>
10
11// Formulations
-
12#include "Bmi_Cpp_Formulation.hpp"
-
13#include "Bmi_C_Formulation.hpp"
-
14#include "Bmi_Fortran_Formulation.hpp"
-
15#include "Bmi_Multi_Formulation.hpp"
-
16#include "Bmi_Py_Formulation.hpp"
-
17#include <GenericDataProvider.hpp>
-
18#include "CsvPerFeatureForcingProvider.hpp"
-
19#include "NullForcingProvider.hpp"
-
20#ifdef NETCDF_ACTIVE
-
21 #include "NetCDFPerFeatureDataProvider.hpp"
-
22#endif
-
23
-
24namespace realization {
-
25 typedef std::shared_ptr<Catchment_Formulation> (*constructor)(std::string, shared_ptr<data_access::GenericDataProvider>, utils::StreamHandler);
-
26
-
27 template<class T>
-
- -
29 return [](std::string id, std::shared_ptr<data_access::GenericDataProvider> forcing_provider, utils::StreamHandler output_stream) -> std::shared_ptr<Catchment_Formulation>{
-
30 return std::make_shared<T>(id, forcing_provider, output_stream);
-
31 };
-
32 }
+
12#include "Bmi_Formulation.hpp"
+
13#include <GenericDataProvider.hpp>
+
14#include "CsvPerFeatureForcingProvider.hpp"
+
15#include "NullForcingProvider.hpp"
+
16#ifdef NETCDF_ACTIVE
+
17 #include "NetCDFPerFeatureDataProvider.hpp"
+
18#endif
+
19
+
20namespace realization {
+
21 using constructor = std::shared_ptr<Catchment_Formulation> (*)(std::string, shared_ptr<data_access::GenericDataProvider>, utils::StreamHandler);
+
22
+
23 extern std::map<std::string, constructor> formulations;
+
24
+
+
25 static std::string valid_formulation_keys(){
+
26 std::string keys = "";
+
27 for(const auto& kv : formulations){
+
28 keys.append(kv.first+" ");
+
29 }
+
30 return keys;
+
31 }
-
33
-
-
34 static std::map<std::string, constructor> formulations = {
-
35 {"bmi_c++", create_formulation_constructor<Bmi_Cpp_Formulation>()},
-
36#ifdef NGEN_BMI_C_LIB_ACTIVE
-
37 {"bmi_c", create_formulation_constructor<Bmi_C_Formulation>()},
-
38#endif // NGEN_BMI_C_LIB_ACTIVE
-
39#ifdef NGEN_BMI_FORTRAN_ACTIVE
-
40 {"bmi_fortran", create_formulation_constructor<Bmi_Fortran_Formulation>()},
-
41#endif // NGEN_BMI_FORTRAN_ACTIVE
-
42 {"bmi_multi", create_formulation_constructor<Bmi_Multi_Formulation>()},
-
43#ifdef ACTIVATE_PYTHON
-
44 {"bmi_python", create_formulation_constructor<Bmi_Py_Formulation>()},
-
45#endif // ACTIVATE_PYTHON
-
46 };
+
32
+
+
33 static bool formulation_exists(std::string formulation_type) {
+
34 return formulations.count(formulation_type) > 0;
+
35 }
-
47
-
-
48 static std::string valid_formulation_keys(){
-
49 std::string keys = "";
-
50 for(const auto& kv : formulations){
-
51 keys.append(kv.first+" ");
-
52 }
-
53 return keys;
-
54 }
+
36
+
+
37 static std::shared_ptr<Catchment_Formulation> construct_formulation(
+
38 std::string formulation_type,
+
39 std::string identifier,
+
40 forcing_params &forcing_config,
+
41 utils::StreamHandler output_stream
+
42 ) {
+
43 constructor formulation_constructor = formulations.at(formulation_type);
+
44 std::shared_ptr<data_access::GenericDataProvider> fp;
+
45 if (forcing_config.provider == "CsvPerFeature" || forcing_config.provider == ""){
+
46 fp = std::make_shared<CsvPerFeatureForcingProvider>(forcing_config);
+
47 }
+
48#ifdef NETCDF_ACTIVE
+
49 else if (forcing_config.provider == "NetCDF"){
+
50 fp = data_access::NetCDFPerFeatureDataProvider::get_shared_provider(forcing_config.path, forcing_config.simulation_start_t, forcing_config.simulation_end_t, output_stream);
+
51 }
+
52#endif
+
53 else if (forcing_config.provider == "NullForcingProvider"){
+
54 fp = std::make_shared<NullForcingProvider>();
+
55 }
+
56 else { // Some unknown string in the provider field?
+
57 throw std::runtime_error(
+
58 "Invalid formulation forcing provider configuration! identifier: \"" + identifier +
+
59 "\", formulation_type: \"" + formulation_type +
+
60 "\", provider: \"" + forcing_config.provider + "\"");
+
61 }
+
62 return formulation_constructor(identifier, fp, output_stream);
+
63 }
-
55
-
-
56 static bool formulation_exists(std::string formulation_type) {
-
57 return formulations.count(formulation_type) > 0;
-
58 }
-
-
59
-
-
60 static std::shared_ptr<Catchment_Formulation> construct_formulation(
-
61 std::string formulation_type,
-
62 std::string identifier,
-
63 forcing_params &forcing_config,
-
64 utils::StreamHandler output_stream
-
65 ) {
-
66 constructor formulation_constructor = formulations.at(formulation_type);
-
67 std::shared_ptr<data_access::GenericDataProvider> fp;
-
68 if (forcing_config.provider == "CsvPerFeature" || forcing_config.provider == ""){
-
69 fp = std::make_shared<CsvPerFeatureForcingProvider>(forcing_config);
-
70 }
-
71#ifdef NETCDF_ACTIVE
-
72 else if (forcing_config.provider == "NetCDF"){
-
73 fp = data_access::NetCDFPerFeatureDataProvider::get_shared_provider(forcing_config.path, forcing_config.simulation_start_t, forcing_config.simulation_end_t, output_stream);
+
64
+
+
65 static std::string get_formulation_key(const boost::property_tree::ptree &tree) {
+
66 /*for (auto &node : tree) {
+
67 if (formulation_exists(node.first)) {
+
68 return node.first;
+
69 }
+
70 }*/
+
71 boost::optional<std::string> key = tree.get_optional<std::string>("name");
+
72 if(key && formulation_exists(*key)){
+
73 return *key;
74 }
-
75#endif
-
76 else if (forcing_config.provider == "NullForcingProvider"){
-
77 fp = std::make_shared<NullForcingProvider>();
-
78 }
-
79 else { // Some unknown string in the provider field?
-
80 throw std::runtime_error(
-
81 "Invalid formulation forcing provider configuration! identifier: \"" + identifier +
-
82 "\", formulation_type: \"" + formulation_type +
-
83 "\", provider: \"" + forcing_config.provider + "\"");
-
84 }
-
85 return formulation_constructor(identifier, fp, output_stream);
-
86 }
-
-
87
-
-
88 static std::string get_formulation_key(const boost::property_tree::ptree &tree) {
-
89 /*for (auto &node : tree) {
-
90 if (formulation_exists(node.first)) {
-
91 return node.first;
-
92 }
-
93 }*/
-
94 boost::optional<std::string> key = tree.get_optional<std::string>("name");
-
95 if(key && formulation_exists(*key)){
-
96 return *key;
-
97 }
-
98
-
99 throw std::runtime_error("No valid formulation for " + *key + " was described in the passed in tree.");
-
100 }
+
75
+
76 throw std::runtime_error("No valid formulation for " + *key + " was described in the passed in tree.");
+
77 }
-
101}
-
102
-
103#endif // NGEN_FORMULATION_CONSTRUCTORS_H
+
78}
+
79
+
80#endif // NGEN_FORMULATION_CONSTRUCTORS_H
This class provides a copyable interface to a std::ostream or std::ostream like object that may not s...
Definition StreamHandler.hpp:14
Definition Bmi_C_Formulation.hpp:11
-
static bool formulation_exists(std::string formulation_type)
Definition Formulation_Constructors.hpp:56
-
static constructor create_formulation_constructor()
Definition Formulation_Constructors.hpp:28
-
static std::string get_formulation_key(const boost::property_tree::ptree &tree)
Definition Formulation_Constructors.hpp:88
-
static std::string valid_formulation_keys()
Definition Formulation_Constructors.hpp:48
-
std::shared_ptr< Catchment_Formulation >(* constructor)(std::string, shared_ptr< data_access::GenericDataProvider >, utils::StreamHandler)
Definition Formulation_Constructors.hpp:25
-
static std::map< std::string, constructor > formulations
Definition Formulation_Constructors.hpp:34
-
static std::shared_ptr< Catchment_Formulation > construct_formulation(std::string formulation_type, std::string identifier, forcing_params &forcing_config, utils::StreamHandler output_stream)
Definition Formulation_Constructors.hpp:60
+
static bool formulation_exists(std::string formulation_type)
Definition Formulation_Constructors.hpp:33
+
std::shared_ptr< Catchment_Formulation >(*)(std::string, shared_ptr< data_access::GenericDataProvider >, utils::StreamHandler) constructor
Definition Formulation_Constructors.hpp:21
+
static std::string get_formulation_key(const boost::property_tree::ptree &tree)
Definition Formulation_Constructors.hpp:65
+
std::map< std::string, constructor > formulations
Definition Formulation_Constructors.cpp:30
+
static std::string valid_formulation_keys()
Definition Formulation_Constructors.hpp:25
+
static std::shared_ptr< Catchment_Formulation > construct_formulation(std::string formulation_type, std::string identifier, forcing_params &forcing_config, utils::StreamHandler output_stream)
Definition Formulation_Constructors.hpp:37
forcing_params providing configuration information for forcing time period and source.
Definition AorcForcing.hpp:35
time_t simulation_start_t
Definition AorcForcing.hpp:41
std::string path
Definition AorcForcing.hpp:36
@@ -232,7 +204,7 @@ diff --git a/_formulation___manager_8hpp_source.html b/_formulation___manager_8hpp_source.html index f4b9a59de2..37d19a16b4 100644 --- a/_formulation___manager_8hpp_source.html +++ b/_formulation___manager_8hpp_source.html @@ -756,9 +756,9 @@
std::shared_ptr< FeatureBase > Feature
An easy name for a smart pointer for FeatureBase and its children.
Definition FeatureBase.hpp:34
Definition Bmi_C_Formulation.hpp:11
-
static bool formulation_exists(std::string formulation_type)
Definition Formulation_Constructors.hpp:56
-
static std::string valid_formulation_keys()
Definition Formulation_Constructors.hpp:48
-
static std::shared_ptr< Catchment_Formulation > construct_formulation(std::string formulation_type, std::string identifier, forcing_params &forcing_config, utils::StreamHandler output_stream)
Definition Formulation_Constructors.hpp:60
+
static bool formulation_exists(std::string formulation_type)
Definition Formulation_Constructors.hpp:33
+
static std::string valid_formulation_keys()
Definition Formulation_Constructors.hpp:25
+
static std::shared_ptr< Catchment_Formulation > construct_formulation(std::string formulation_type, std::string identifier, forcing_params &forcing_config, utils::StreamHandler output_stream)
Definition Formulation_Constructors.hpp:37
forcing_params providing configuration information for forcing time period and source.
Definition AorcForcing.hpp:35
A simple structure to hold meta data related to a computational layer.
Definition LayerData.hpp:18
std::string time_step_units
Definition LayerData.hpp:20
@@ -786,7 +786,7 @@ diff --git a/_g_m___object_8hpp_source.html b/_g_m___object_8hpp_source.html index dde1678194..13870c17e1 100644 --- a/_g_m___object_8hpp_source.html +++ b/_g_m___object_8hpp_source.html @@ -129,7 +129,7 @@ diff --git a/_generic_data_provider_8hpp_source.html b/_generic_data_provider_8hpp_source.html index c36a75d67c..02541a5507 100644 --- a/_generic_data_provider_8hpp_source.html +++ b/_generic_data_provider_8hpp_source.html @@ -125,7 +125,7 @@ diff --git a/_grid_polygon_8hpp_source.html b/_grid_polygon_8hpp_source.html index 58044c9083..8b28edb6fe 100644 --- a/_grid_polygon_8hpp_source.html +++ b/_grid_polygon_8hpp_source.html @@ -199,7 +199,7 @@ diff --git a/_h_y___cartographic_realization_8hpp_source.html b/_h_y___cartographic_realization_8hpp_source.html index dfc85b81c9..647fbc604b 100644 --- a/_h_y___cartographic_realization_8hpp_source.html +++ b/_h_y___cartographic_realization_8hpp_source.html @@ -127,7 +127,7 @@ diff --git a/_h_y___catchment_8hpp_source.html b/_h_y___catchment_8hpp_source.html index 6209ed4ef4..6f4920d0ef 100644 --- a/_h_y___catchment_8hpp_source.html +++ b/_h_y___catchment_8hpp_source.html @@ -206,7 +206,7 @@ diff --git a/_h_y___catchment_aggregate_8hpp_source.html b/_h_y___catchment_aggregate_8hpp_source.html index 694d2c4525..df4ef4a3ea 100644 --- a/_h_y___catchment_aggregate_8hpp_source.html +++ b/_h_y___catchment_aggregate_8hpp_source.html @@ -127,7 +127,7 @@ diff --git a/_h_y___catchment_area_8hpp_source.html b/_h_y___catchment_area_8hpp_source.html index 408253a22f..abf868b131 100644 --- a/_h_y___catchment_area_8hpp_source.html +++ b/_h_y___catchment_area_8hpp_source.html @@ -150,7 +150,7 @@ diff --git a/_h_y___catchment_divide_8hpp_source.html b/_h_y___catchment_divide_8hpp_source.html index 1d46720423..1eba1f3983 100644 --- a/_h_y___catchment_divide_8hpp_source.html +++ b/_h_y___catchment_divide_8hpp_source.html @@ -149,7 +149,7 @@ diff --git a/_h_y___catchment_realization_8hpp_source.html b/_h_y___catchment_realization_8hpp_source.html index 08737ab2bd..4aec6a0436 100644 --- a/_h_y___catchment_realization_8hpp_source.html +++ b/_h_y___catchment_realization_8hpp_source.html @@ -163,7 +163,7 @@ diff --git a/_h_y___dendritic_catchment_8hpp_source.html b/_h_y___dendritic_catchment_8hpp_source.html index 398ca251ce..7c4275b421 100644 --- a/_h_y___dendritic_catchment_8hpp_source.html +++ b/_h_y___dendritic_catchment_8hpp_source.html @@ -127,7 +127,7 @@ diff --git a/_h_y___distance_discription_8hpp_source.html b/_h_y___distance_discription_8hpp_source.html index 47151b5327..aa7a8a0f69 100644 --- a/_h_y___distance_discription_8hpp_source.html +++ b/_h_y___distance_discription_8hpp_source.html @@ -119,7 +119,7 @@ diff --git a/_h_y___features_8hpp_source.html b/_h_y___features_8hpp_source.html index 813d1c175e..ae4284bec7 100644 --- a/_h_y___features_8hpp_source.html +++ b/_h_y___features_8hpp_source.html @@ -244,7 +244,7 @@ diff --git a/_h_y___features___ids_8hpp_source.html b/_h_y___features___ids_8hpp_source.html index 9f2bfe7162..ebb4794bb6 100644 --- a/_h_y___features___ids_8hpp_source.html +++ b/_h_y___features___ids_8hpp_source.html @@ -153,7 +153,7 @@ diff --git a/_h_y___features___m_p_i_8hpp_source.html b/_h_y___features___m_p_i_8hpp_source.html index 36fcb0d376..a0155b9f17 100644 --- a/_h_y___features___m_p_i_8hpp_source.html +++ b/_h_y___features___m_p_i_8hpp_source.html @@ -182,7 +182,7 @@
87 std::unordered_map<std::string, std::shared_ptr<HY_Catchment>> _catchments;
88 std::unordered_map<std::string, std::shared_ptr<HY_PointHydroNexusRemote>> _nexuses;
-
90 std::shared_ptr<Formulation_Manager> formulations;
+
90 std::shared_ptr<Formulation_Manager> formulations;
91 std::set<long> hf_layers;
92 int mpi_rank;
93 int mpi_num_procs;
@@ -196,6 +196,7 @@
std::shared_ptr< FeatureCollection > GeoJSON
Easy short-hand for a smart pointer to a FeatureCollection.
Definition FeatureBuilder.hpp:21
HY_HydroLocation: class representing a hydrologic position.
Definition HY_Features.hpp:13
Definition network.hpp:22
+
std::map< std::string, constructor > formulations
Definition Formulation_Constructors.cpp:30
Definition Partition_Data.hpp:5
@@ -203,7 +204,7 @@ diff --git a/_h_y___flow_path_8hpp_source.html b/_h_y___flow_path_8hpp_source.html index a64f0a879d..60ca89c384 100644 --- a/_h_y___flow_path_8hpp_source.html +++ b/_h_y___flow_path_8hpp_source.html @@ -148,7 +148,7 @@ diff --git a/_h_y___hydro_feature_8hpp_source.html b/_h_y___hydro_feature_8hpp_source.html index 7dbd76e369..119408594e 100644 --- a/_h_y___hydro_feature_8hpp_source.html +++ b/_h_y___hydro_feature_8hpp_source.html @@ -124,7 +124,7 @@ diff --git a/_h_y___hydro_location_8hpp_source.html b/_h_y___hydro_location_8hpp_source.html index 90e2a4b3c1..8ab4ef32c7 100644 --- a/_h_y___hydro_location_8hpp_source.html +++ b/_h_y___hydro_location_8hpp_source.html @@ -182,7 +182,7 @@ diff --git a/_h_y___hydro_location_type_8hpp_source.html b/_h_y___hydro_location_type_8hpp_source.html index 43f5e896de..d8462da900 100644 --- a/_h_y___hydro_location_type_8hpp_source.html +++ b/_h_y___hydro_location_type_8hpp_source.html @@ -166,7 +166,7 @@ diff --git a/_h_y___hydro_network_8hpp_source.html b/_h_y___hydro_network_8hpp_source.html index 4668b04c27..4822ddf028 100644 --- a/_h_y___hydro_network_8hpp_source.html +++ b/_h_y___hydro_network_8hpp_source.html @@ -163,7 +163,7 @@ diff --git a/_h_y___hydro_nexus_8hpp_source.html b/_h_y___hydro_nexus_8hpp_source.html index 0d8c90fe03..9ca763e908 100644 --- a/_h_y___hydro_nexus_8hpp_source.html +++ b/_h_y___hydro_nexus_8hpp_source.html @@ -213,7 +213,7 @@ diff --git a/_h_y___indirect_position_8hpp_source.html b/_h_y___indirect_position_8hpp_source.html index e543732cb2..44addf7e27 100644 --- a/_h_y___indirect_position_8hpp_source.html +++ b/_h_y___indirect_position_8hpp_source.html @@ -189,7 +189,7 @@ diff --git a/_h_y___interior_catchment_8hpp_source.html b/_h_y___interior_catchment_8hpp_source.html index 6eddd9b4bf..160595def4 100644 --- a/_h_y___interior_catchment_8hpp_source.html +++ b/_h_y___interior_catchment_8hpp_source.html @@ -127,7 +127,7 @@ diff --git a/_h_y___point_hydro_nexus_8hpp_source.html b/_h_y___point_hydro_nexus_8hpp_source.html index c8434b52d9..bf40cd2d1e 100644 --- a/_h_y___point_hydro_nexus_8hpp_source.html +++ b/_h_y___point_hydro_nexus_8hpp_source.html @@ -168,7 +168,7 @@ diff --git a/_h_y___point_hydro_nexus_remote_8hpp_source.html b/_h_y___point_hydro_nexus_remote_8hpp_source.html index 29d0813439..c23e0520e2 100644 --- a/_h_y___point_hydro_nexus_remote_8hpp_source.html +++ b/_h_y___point_hydro_nexus_remote_8hpp_source.html @@ -233,7 +233,7 @@ diff --git a/_hydrofabric_subsetter_8hpp_source.html b/_hydrofabric_subsetter_8hpp_source.html index 8732033d7d..4a52580fbe 100644 --- a/_hydrofabric_subsetter_8hpp_source.html +++ b/_hydrofabric_subsetter_8hpp_source.html @@ -224,7 +224,7 @@ diff --git a/_interpreter_util_8hpp_source.html b/_interpreter_util_8hpp_source.html index 0513bd4968..c5c16ff3cd 100644 --- a/_interpreter_util_8hpp_source.html +++ b/_interpreter_util_8hpp_source.html @@ -317,7 +317,7 @@ diff --git a/_j_s_o_n_geometry_8hpp_source.html b/_j_s_o_n_geometry_8hpp_source.html index ce49f4ac19..ab5b2c1165 100644 --- a/_j_s_o_n_geometry_8hpp_source.html +++ b/_j_s_o_n_geometry_8hpp_source.html @@ -306,7 +306,7 @@ diff --git a/_j_s_o_n_property_8hpp_source.html b/_j_s_o_n_property_8hpp_source.html index 383ae310ce..9cb330e21d 100644 --- a/_j_s_o_n_property_8hpp_source.html +++ b/_j_s_o_n_property_8hpp_source.html @@ -701,7 +701,7 @@ diff --git a/_layer_8hpp_source.html b/_layer_8hpp_source.html index 286d14c46f..f5410690ba 100644 --- a/_layer_8hpp_source.html +++ b/_layer_8hpp_source.html @@ -282,7 +282,7 @@ diff --git a/_layer_data_8hpp_source.html b/_layer_data_8hpp_source.html index 2173db5e73..43be2ccff9 100644 --- a/_layer_data_8hpp_source.html +++ b/_layer_data_8hpp_source.html @@ -180,7 +180,7 @@ diff --git a/_line_string_feature_8hpp_source.html b/_line_string_feature_8hpp_source.html index f8eda6ccfd..e669705c34 100644 --- a/_line_string_feature_8hpp_source.html +++ b/_line_string_feature_8hpp_source.html @@ -176,7 +176,7 @@ diff --git a/_multi_line_string_feature_8hpp_source.html b/_multi_line_string_feature_8hpp_source.html index 45a5590275..7afe2545b8 100644 --- a/_multi_line_string_feature_8hpp_source.html +++ b/_multi_line_string_feature_8hpp_source.html @@ -176,7 +176,7 @@ diff --git a/_multi_point_feature_8hpp_source.html b/_multi_point_feature_8hpp_source.html index 9dc84997af..19968a5425 100644 --- a/_multi_point_feature_8hpp_source.html +++ b/_multi_point_feature_8hpp_source.html @@ -176,7 +176,7 @@ diff --git a/_multi_polygon_feature_8hpp_source.html b/_multi_polygon_feature_8hpp_source.html index 3ac71da47f..056c5b909c 100644 --- a/_multi_polygon_feature_8hpp_source.html +++ b/_multi_polygon_feature_8hpp_source.html @@ -175,7 +175,7 @@ diff --git a/_net_c_d_f_per_feature_data_provider_8hpp_source.html b/_net_c_d_f_per_feature_data_provider_8hpp_source.html index 4d1e0964d8..ad56feee2b 100644 --- a/_net_c_d_f_per_feature_data_provider_8hpp_source.html +++ b/_net_c_d_f_per_feature_data_provider_8hpp_source.html @@ -220,7 +220,7 @@ diff --git a/_nexus___manager_8hpp_source.html b/_nexus___manager_8hpp_source.html index 106686ad76..caf578d27f 100644 --- a/_nexus___manager_8hpp_source.html +++ b/_nexus___manager_8hpp_source.html @@ -280,7 +280,7 @@ diff --git a/_null_forcing_provider_8hpp_source.html b/_null_forcing_provider_8hpp_source.html index 21b2df224e..8e63e2bfe4 100644 --- a/_null_forcing_provider_8hpp_source.html +++ b/_null_forcing_provider_8hpp_source.html @@ -187,7 +187,7 @@ diff --git a/_optional_wrapped_data_provider_8hpp_source.html b/_optional_wrapped_data_provider_8hpp_source.html index 95cc86f554..eafd6a4e0b 100644 --- a/_optional_wrapped_data_provider_8hpp_source.html +++ b/_optional_wrapped_data_provider_8hpp_source.html @@ -399,7 +399,7 @@ diff --git a/_partition___data_8hpp_source.html b/_partition___data_8hpp_source.html index 5ffef604c5..9a8a3b2f11 100644 --- a/_partition___data_8hpp_source.html +++ b/_partition___data_8hpp_source.html @@ -124,7 +124,7 @@ diff --git a/_partition___one_8hpp_source.html b/_partition___one_8hpp_source.html index 1e94644a4f..1c292225c4 100644 --- a/_partition___one_8hpp_source.html +++ b/_partition___one_8hpp_source.html @@ -147,7 +147,7 @@ diff --git a/_partition___parser_8hpp_source.html b/_partition___parser_8hpp_source.html index 171ae44aa4..2824d40c40 100644 --- a/_partition___parser_8hpp_source.html +++ b/_partition___parser_8hpp_source.html @@ -300,7 +300,7 @@ diff --git a/_point_feature_8hpp_source.html b/_point_feature_8hpp_source.html index 36a0cf06b9..0f2a4361f6 100644 --- a/_point_feature_8hpp_source.html +++ b/_point_feature_8hpp_source.html @@ -176,7 +176,7 @@ diff --git a/_polygon_feature_8hpp_source.html b/_polygon_feature_8hpp_source.html index f5e13ad621..d30bd201e6 100644 --- a/_polygon_feature_8hpp_source.html +++ b/_polygon_feature_8hpp_source.html @@ -167,7 +167,7 @@ diff --git a/_routing___params_8h_source.html b/_routing___params_8h_source.html index 6159b9f3c2..92f84d3b56 100644 --- a/_routing___params_8h_source.html +++ b/_routing___params_8h_source.html @@ -136,7 +136,7 @@ diff --git a/_routing___py___adapter_8hpp_source.html b/_routing___py___adapter_8hpp_source.html index cdcaae6ac8..54706059ff 100644 --- a/_routing___py___adapter_8hpp_source.html +++ b/_routing___py___adapter_8hpp_source.html @@ -171,7 +171,7 @@ diff --git a/_simulation___time_8hpp_source.html b/_simulation___time_8hpp_source.html index 0ad014a737..4ed981aae0 100644 --- a/_simulation___time_8hpp_source.html +++ b/_simulation___time_8hpp_source.html @@ -299,7 +299,7 @@ diff --git a/_state___exception_8hpp_source.html b/_state___exception_8hpp_source.html index 2175b4cd89..03d15447c9 100644 --- a/_state___exception_8hpp_source.html +++ b/_state___exception_8hpp_source.html @@ -157,7 +157,7 @@ diff --git a/_stream_handler_8hpp_source.html b/_stream_handler_8hpp_source.html index 2a72629c7e..912093e116 100644 --- a/_stream_handler_8hpp_source.html +++ b/_stream_handler_8hpp_source.html @@ -239,7 +239,7 @@ diff --git a/_surface_layer_8hpp_source.html b/_surface_layer_8hpp_source.html index 6326e37fa7..8fa02fb7b1 100644 --- a/_surface_layer_8hpp_source.html +++ b/_surface_layer_8hpp_source.html @@ -156,7 +156,7 @@ diff --git a/_units_helper_8hpp_source.html b/_units_helper_8hpp_source.html index cf26de91fe..302d9ab379 100644 --- a/_units_helper_8hpp_source.html +++ b/_units_helper_8hpp_source.html @@ -178,7 +178,7 @@ diff --git a/_wrapped_data_provider_8hpp_source.html b/_wrapped_data_provider_8hpp_source.html index f333b822a9..5d8ca15896 100644 --- a/_wrapped_data_provider_8hpp_source.html +++ b/_wrapped_data_provider_8hpp_source.html @@ -214,7 +214,7 @@ diff --git a/all_8h_source.html b/all_8h_source.html index 2e88179c66..81b2166ee0 100644 --- a/all_8h_source.html +++ b/all_8h_source.html @@ -109,7 +109,7 @@ diff --git a/annotated.html b/annotated.html index 5b7171bc11..7087752896 100644 --- a/annotated.html +++ b/annotated.html @@ -249,7 +249,7 @@ diff --git a/bmi_8h_source.html b/bmi_8h_source.html index 936dabf030..14b3156241 100644 --- a/bmi_8h_source.html +++ b/bmi_8h_source.html @@ -271,7 +271,7 @@ diff --git a/bmi_8hpp_source.html b/bmi_8hpp_source.html index 12ee58a8b2..a055b9d055 100644 --- a/bmi_8hpp_source.html +++ b/bmi_8hpp_source.html @@ -250,7 +250,7 @@ diff --git a/bmi__utilities_8hpp_source.html b/bmi__utilities_8hpp_source.html index 0abd6aee29..57fd96b94e 100644 --- a/bmi__utilities_8hpp_source.html +++ b/bmi__utilities_8hpp_source.html @@ -213,7 +213,7 @@
virtual int GetVarItemsize(std::string name)=0
virtual int GetVarNbytes(std::string name)=0
Abstract adapter interface for C++ classes to interact with the essential aspects of external models ...
Definition Bmi_Adapter.hpp:19
-
std::string get_model_name()
Get the model name.
Definition Bmi_Adapter.hpp:216
+
std::string get_model_name()
Get the model name.
Definition Bmi_Adapter.hpp:223
virtual const std::string get_analogous_cxx_type(const std::string &external_type_name, const size_t item_size)=0
Get the name string for the C++ type analogous to the described type in the backing model.
Definition bmi.hpp:16
static std::vector< TO > make_vector(const FROM *data, const size_t &count)
make a vector of type
Definition bmi_utilities.hpp:25
@@ -225,7 +225,7 @@ diff --git a/catchment_2formulation_8hpp_source.html b/catchment_2formulation_8hpp_source.html index 4a5730a85d..12fbc54fb5 100644 --- a/catchment_2formulation_8hpp_source.html +++ b/catchment_2formulation_8hpp_source.html @@ -244,7 +244,7 @@ diff --git a/class_b_m_i_data_selector-members.html b/class_b_m_i_data_selector-members.html index 0b2ee3e28d..184ac4cdfa 100644 --- a/class_b_m_i_data_selector-members.html +++ b/class_b_m_i_data_selector-members.html @@ -118,7 +118,7 @@ diff --git a/class_b_m_i_data_selector.html b/class_b_m_i_data_selector.html index a632fc4110..e670d93d5b 100644 --- a/class_b_m_i_data_selector.html +++ b/class_b_m_i_data_selector.html @@ -243,7 +243,7 @@

References CatchmentAggrDataSelector::duration_s.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -305,7 +305,7 @@

References CatchmentAggrDataSelector::init_time.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -337,7 +337,7 @@

References CatchmentAggrDataSelector::output_units.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -369,7 +369,7 @@

References CatchmentAggrDataSelector::variable_name.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -691,7 +691,7 @@

    - +
diff --git a/class_c_s_v_data_selector-members.html b/class_c_s_v_data_selector-members.html index 1cc42954f0..76b6dbe7d3 100644 --- a/class_c_s_v_data_selector-members.html +++ b/class_c_s_v_data_selector-members.html @@ -118,7 +118,7 @@ diff --git a/class_c_s_v_data_selector.html b/class_c_s_v_data_selector.html index 678ace4f25..0c64e63c68 100644 --- a/class_c_s_v_data_selector.html +++ b/class_c_s_v_data_selector.html @@ -248,7 +248,7 @@

References CatchmentAggrDataSelector::duration_s.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -310,7 +310,7 @@

References CatchmentAggrDataSelector::init_time.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -342,7 +342,7 @@

References CatchmentAggrDataSelector::output_units.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -374,7 +374,7 @@

References CatchmentAggrDataSelector::variable_name.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -696,7 +696,7 @@

    - +
diff --git a/class_c_s_v_reader-members.html b/class_c_s_v_reader-members.html index 9d75a36387..87c88ba1b0 100644 --- a/class_c_s_v_reader-members.html +++ b/class_c_s_v_reader-members.html @@ -104,7 +104,7 @@ diff --git a/class_c_s_v_reader.html b/class_c_s_v_reader.html index 094914c3ae..dadb286d81 100644 --- a/class_c_s_v_reader.html +++ b/class_c_s_v_reader.html @@ -247,7 +247,7 @@

    - +
diff --git a/class_catchment_aggr_data_selector-members.html b/class_catchment_aggr_data_selector-members.html index 460291de7f..bd14a5bd03 100644 --- a/class_catchment_aggr_data_selector-members.html +++ b/class_catchment_aggr_data_selector-members.html @@ -117,7 +117,7 @@ diff --git a/class_catchment_aggr_data_selector.html b/class_catchment_aggr_data_selector.html index 3401066198..89587cf377 100644 --- a/class_catchment_aggr_data_selector.html +++ b/class_catchment_aggr_data_selector.html @@ -299,7 +299,7 @@

References duration_s.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -361,7 +361,7 @@

References init_time.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -393,7 +393,7 @@

References output_units.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -425,7 +425,7 @@

References variable_name.

-

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation< M >::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation< M >::get_values().

+

Referenced by CsvPerFeatureForcingProvider::get_value(), data_access::OptionalWrappedDataProvider::get_value(), realization::Bmi_Module_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_value(), realization::Bmi_Multi_Formulation::get_values(), and realization::Bmi_Module_Formulation::get_values().

@@ -747,7 +747,7 @@

    - +
diff --git a/class_csv_per_feature_forcing_provider-members.html b/class_csv_per_feature_forcing_provider-members.html index 8b23ec6df1..5558c6c3af 100644 --- a/class_csv_per_feature_forcing_provider-members.html +++ b/class_csv_per_feature_forcing_provider-members.html @@ -132,7 +132,7 @@ diff --git a/class_csv_per_feature_forcing_provider.html b/class_csv_per_feature_forcing_provider.html index 94cb8bc529..adbb554aec 100644 --- a/class_csv_per_feature_forcing_provider.html +++ b/class_csv_per_feature_forcing_provider.html @@ -1147,7 +1147,7 @@

    - +
diff --git a/class_feature___test-members.html b/class_feature___test-members.html index 129d7795a6..f15dd4e8ba 100644 --- a/class_feature___test-members.html +++ b/class_feature___test-members.html @@ -104,7 +104,7 @@ diff --git a/class_feature___test.html b/class_feature___test.html index 8c07fcccf0..e0dbeb095c 100644 --- a/class_feature___test.html +++ b/class_feature___test.html @@ -232,7 +232,7 @@

    - +
diff --git a/class_feature_collection___test-members.html b/class_feature_collection___test-members.html index 9413742631..cf880dff72 100644 --- a/class_feature_collection___test-members.html +++ b/class_feature_collection___test-members.html @@ -104,7 +104,7 @@ diff --git a/class_feature_collection___test.html b/class_feature_collection___test.html index 7ea4c95cf0..4aa0f8495b 100644 --- a/class_feature_collection___test.html +++ b/class_feature_collection___test.html @@ -232,7 +232,7 @@

    - +
diff --git a/class_g_m___object-members.html b/class_g_m___object-members.html index 5b9e0ea188..322176bfd2 100644 --- a/class_g_m___object-members.html +++ b/class_g_m___object-members.html @@ -102,7 +102,7 @@ diff --git a/class_g_m___object.html b/class_g_m___object.html index 53162841d6..fc35e5c729 100644 --- a/class_g_m___object.html +++ b/class_g_m___object.html @@ -172,7 +172,7 @@

    - +
diff --git a/class_g_m___object__inherit__graph.map b/class_g_m___object__inherit__graph.map index ad88488441..7a4cf226bd 100644 --- a/class_g_m___object__inherit__graph.map +++ b/class_g_m___object__inherit__graph.map @@ -1,31 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/class_g_m___object__inherit__graph.md5 b/class_g_m___object__inherit__graph.md5 index 8f3f0647bd..32d7956880 100644 --- a/class_g_m___object__inherit__graph.md5 +++ b/class_g_m___object__inherit__graph.md5 @@ -1 +1 @@ -b492bd4782be60b231579e12041c679e \ No newline at end of file +6efb1bc43b7925a480d3b6b8dcfa3f7e \ No newline at end of file diff --git a/class_g_m___object__inherit__graph.svg b/class_g_m___object__inherit__graph.svg index 8f7da5cacd..ec8c51979f 100644 --- a/class_g_m___object__inherit__graph.svg +++ b/class_g_m___object__inherit__graph.svg @@ -4,7 +4,7 @@ - +