netxsimdg
Loading...
Searching...
No Matches
Model.hpp
Go to the documentation of this file.
1
7#ifndef MODEL_HPP
8#define MODEL_HPP
9
10#include "include/Logged.hpp"
11
13#include "include/Iterator.hpp"
17
18#include "DevStep.hpp"
19#include <string>
20
21namespace Nextsim {
22
24class Model : public Configured<Model> {
25public:
26 Model(); // TODO add arguments to pass the desired
27 // environment and configuration to the model
28 ~Model(); // Finalize the model. Collect data and so on.
29
30 void configure() override;
31 enum {
32 RESTARTFILE_KEY,
33 STARTTIME_KEY,
34 STOPTIME_KEY,
35 RUNLENGTH_KEY,
36 TIMESTEP_KEY,
37 MISSINGVALUE_KEY,
38 };
39
40 ConfigMap getConfig() const;
41
42 static HelpMap& getHelpText(HelpMap& map, bool getAll);
43 static HelpMap& getHelpRecursive(HelpMap& map, bool getAll);
44
46 void run();
47
48 void writeRestartFile();
49
51 void setFinalFilename(const std::string& finalFile);
52
55
56 // Configuration option that holds the restart file name
57 const static std::string restartOptionName;
58
59private:
60 Iterator iterator;
61 DevStep modelStep; // Change the model step calculation here
62 PrognosticData pData;
63 ModelMetadata m_etadata;
64
65 std::string initialFileName;
66 std::string finalFileName;
67
68 // Cached values of the start-step-stop/duration times
69 std::string startTimeStr;
70 std::string stopTimeStr;
71 std::string durationStr;
72 std::string stepStr;
73};
74
75} /* namespace Nextsim */
76
77#endif /* MODEL_HPP */
A class providing a simple implementation of Iterator.
Definition DevStep.hpp:19
A class that controls how time steps are performed.
Definition Iterator.hpp:16
A class that encapsulates the whole of the model.
Definition Model.hpp:24
void configure() override
The configuration function.
Definition Model.cpp:59
void setFinalFilename(const std::string &finalFile)
Sets the filename of the restart file that would currently be written out.
void run()
Run the model.
Definition Model.cpp:132
ModelMetadata & metadata()
Gets the model metadata instance.
Definition Model.cpp:146