netxsimdg
Loading...
Searching...
No Matches
IModelStep.hpp
Go to the documentation of this file.
1
8#ifndef IMODELSTEP_HPP
9#define IMODELSTEP_HPP
10
11#include "include/Iterator.hpp"
14
15namespace Nextsim {
16
19public:
20 IModelStep() = default;
21 virtual ~IModelStep() = default;
28 void setInitFile(const std::string& filePath) { initialRestartFilePath = filePath; };
29
36 virtual void writeRestartFile(const std::string& filePath) = 0;
37
43 virtual void setData(PrognosticData& data) = 0;
44
55 virtual void setMetadata(ModelMetadata& meta) = 0;
56
57 // Member functions inherited from Iterant
58 virtual void init() = 0;
59 virtual void start(const TimePoint& startTime) = 0;
60 virtual void iterate(const TimestepTime& dt) = 0;
61 virtual void stop(const TimePoint& stopTime) = 0;
62
63protected:
64 std::string initialRestartFilePath;
65};
66
67} /* namespace Nextsim */
68
69#endif /* IMODELSTEP_HPP */
An interface class extending Iterator::Iterant with some file name handling.
virtual void setMetadata(ModelMetadata &meta)=0
Sets the metadata object that will be used within the timesteps.
virtual void stop(const TimePoint &stopTime)=0
void setInitFile(const std::string &filePath)
Sets the path to the initial file for later reference.
virtual void start(const TimePoint &startTime)=0
virtual void writeRestartFile(const std::string &filePath)=0
Writes a restart file containing the current model state to the given file location.
virtual void setData(PrognosticData &data)=0
Sets the data object that will be used within the timesteps.
virtual void init()=0
Initializes the model, based on some environment stored in the implementing class.
virtual void iterate(const TimestepTime &dt)=0
A base class for classes that specify what happens during one timestep.
Definition Iterator.hpp:76