-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlooidsArray.hpp
More file actions
65 lines (53 loc) · 1018 Bytes
/
FlooidsArray.hpp
File metadata and controls
65 lines (53 loc) · 1018 Bytes
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
57
58
59
60
61
62
63
64
65
#ifndef FLOOIDSARRAY_HPP_
#define FLOOIDSARRAY_HPP_
#include <string>
class Grid {
private:
int nx_ = 0;
int ng_ = 0;
double* data_;
public:
Grid(const int N, const int G) {
nx_ = N;
ng_ = G;
data_ = new double[nx_*nx_];
for (int i=0; i<nx_*nx_; i++)
{
data_[i]=0.;
}
};
~Grid() {
delete[] data_;
};
void shout();
int index(const int i, const int j);
void WriteData(const std::string filename);
void PrintAll();
double GetVal(const int i, const int j);
};
class Flooid {
private:
int nx_ = 0;
int ng_ = 0;
Grid *rho;
Grid *vx;
Grid *vy;
public:
Flooid(const int N, const int G) {
nx_ = N;
ng_ = G;
rho = new Grid(N,G);
vx = new Grid(N,G);
vy = new Grid(N,G);
};
~Flooid() {
delete rho;
delete vx;
delete vy;
};
void shout();
int index(const int i, const int j);
void WriteData();
void Print();
};
#endif // FLOOIDSARRAY_HPP_