generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f57fec0
commit 40c48e2
Showing
28 changed files
with
1,135 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#ifndef __NGEN_DOMAIN_LAYER__ | ||
#define __NGEN_DOMAIN_LAYER__ | ||
|
||
#include "Catchment_Formulation.hpp" | ||
#include "Layer.hpp" | ||
|
||
namespace ngen | ||
{ | ||
class DomainLayer : public Layer | ||
{ | ||
public: | ||
// DomainLayer() = delete; | ||
DomainLayer( | ||
const LayerDescription& desc, | ||
const Simulation_Time& s_t, | ||
feature_type& features, | ||
long idx, | ||
std::shared_ptr<realization::Catchment_Formulation> formulation): | ||
//description(desc), features(features), output_time_index(0), simulation_time(s_t), formulation(formulation) | ||
Layer(desc, s_t, features, idx), formulation(formulation) | ||
{ | ||
formulation->write_output("Time Step,""Time,"+formulation->get_output_header_line(",")+"\n"); | ||
} | ||
|
||
/*** | ||
* @brief Run one simulation timestep for each model in this layer | ||
*/ | ||
void update_models() override{ | ||
formulation->get_response(output_time_index, simulation_time.get_output_interval_seconds()); | ||
std::string current_timestamp = simulation_time.get_timestamp(output_time_index); | ||
std::string output = std::to_string(output_time_index)+","+current_timestamp+","+ | ||
formulation->get_output_line_for_timestep(output_time_index)+"\n"; | ||
formulation->write_output(output); | ||
++output_time_index; | ||
if ( output_time_index < simulation_time.get_total_output_times() ) | ||
{ | ||
simulation_time.advance_timestep(); | ||
} | ||
|
||
} | ||
|
||
private: | ||
// LayerDescription description; | ||
// Simulation_Time simulation_time; | ||
// long output_time_index; | ||
std::shared_ptr<realization::Catchment_Formulation> formulation; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.