-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimulation.h
33 lines (27 loc) · 1.12 KB
/
Simulation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include "Model.h"
#include "boost/filesystem/fstream.hpp"
#include "boost/filesystem.hpp"
namespace bfs = boost::filesystem;
class Simulation {
public:
Simulation(Model& _model, const bfs::path& _paramFilePath, const bfs::path& _inputFilePath, const bfs::path& _outputFilePath);
void Simulate(const float tFinal) { Simulate(tFinal, 0.1f); };
void Simulate(const float tFinal, const float dt);
void ConfirmFiles();
// reads from paramFilePath and initializes the model data with the appropriate parameters
void ReadParamFile();
// reads from inputFilePath for the given time, and updates the model data with the appropriate inputs using a Zero-Order-Hold approach
void ReadInputFile(float t);
// writes to outputFilePath for the given time, including a header on the first call
void WriteOutputFile(float t);
// creates a template parameter file, will not be runnable
void CreateTemplateParamFile();
// creates a template input file, will not be runnable
void CreateTemplateInputFile();
private:
Model& model;
const bfs::path& paramFilePath;
const bfs::path& inputFilePath;
const bfs::path& outputFilePath;
};