-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaverages_module.hpp
56 lines (41 loc) · 1.4 KB
/
averages_module.hpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <string>
#include <ctime>
#include <vector>
#include "./maths_module.hpp"
// Options for averaging methods
#define avg 0
#define msd 1
#define cke 2
class VariableType{
// Class encapsulating the essential information for simulation averages.
public:
const char* nam;
double val;
double add = 0.0;
int method = avg;
bool e_format = false;
bool instant = true;
};
class BlockVar{
public:
double blc_nrm = 0.0;
double run_nrm = 0.0;
double* run_avg = new double[12];
double* run_err = new double[12];
double* blk_avg = new double[12];
double* blk_msd = new double[12];
double* values = new double[12];
double* addd = new double[12];
bool* mask = new bool[12];
int* methodd = new int[12];
};
void time_stamp(bool end, std::clock_t ti);
std::vector<std::string> word_splitter(std::string str);
void run_begin (std::vector<VariableType> vars, BlockVar &blk_var,std::clock_t ti);
void blk_begin(int n_avg, BlockVar &blk_var);
void blk_add (std::vector<VariableType> vars, BlockVar &blk_var);
void blk_end (int blk, int n_avg, BlockVar &blk_var);
void run_end (std::vector<VariableType> vars, BlockVar &blk_var, std::clock_t ti);