-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlowField.h
116 lines (92 loc) · 3.53 KB
/
FlowField.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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef _FLOW_FIELD_H_
#define _FLOW_FIELD_H_
#include "DataStructures.h"
#include "Parameters.h"
/** Flow field
*
* Class intended to contain the state of the domain.
*/
class FlowField {
protected:
const int _size_x; //! Size in the X direction
const int _size_y; //! Size in the Y direction
const int _size_z; //! Size in the Z direction
const int _cellsX;
const int _cellsY;
const int _cellsZ;
ScalarField _pressure; //! Scalar field representing the pressure
VectorField _velocity; //! Multicomponent field representing velocity
IntScalarField _flags; //! Integer field for the flags
VectorField _FGH;
ScalarField _RHS; //! Right hand side for the Poisson equation
public:
/** Constructor for the 2D flow field
*
* Constructor for the flow field. Allocates all the fields and sets
* the sizes. Currently, this contructor is only used for testing purposes.
*
* @param Nx Size of the fuild domain (non-ghost cells), in the X direction
* @param Ny Size of the fuild domain (non-ghost cells), in the Y direction
*/
FlowField (int Nx, int Ny, int Nz);
/** Constructor for the 3D flow field
*
* Constructor for the flow field. Allocates all the fields and sets
* the sizes. Currently, this contructor is only used for testing purposes.
*
* @param Nx Size of the fuild domain (non-ghost cells), in the X direction
* @param Ny Size of the fuild domain (non-ghost cells), in the Y direction
* @param Nz Size of the fuild domain (non-ghost cells), in the Z direction
*/
FlowField ( int Nx, int Ny );
/** Constructs a field from parameters object
*
* Constructs a field from a parameters object, so that it dimensionality can be defined in
* the configuration file.
*
* @param parameters Parameters object with geometric information
*/
FlowField (const Parameters & parameters);
/** Obtain size in the X direction
*
* @return Number of cells in the X direction
*/
int getNx () const;
/** Obtain size in the Y direction
*
* @return Number of cells in the Y direction
*/
int getNy () const;
/** Obtain size in the Z direction
*
* @return Number of cells in the Z direction
*/
int getNz () const;
int getCellsX() const;
int getCellsY() const;
int getCellsZ() const;
/** Get pressure field
* @return Reference to pressure field
*/
ScalarField & getPressure ();
/** Get velocity field
* @return Reference to velocity field
*/
VectorField & getVelocity ();
/** Get flag field
* @return Reference to flag field
*/
IntScalarField & getFlags ();
/** Get the field with the F, G, and H abbreviations
* @return Multi-component field with F, G and H
*/
VectorField & getFGH ();
/** Get the right hand side for the pressure linear solver
* @return Scalar field with the right hand side
*/
ScalarField & getRHS ();
void getPressureAndVelocity(FLOAT &pressure, FLOAT* const velocity, int i, int j);
void getPressureAndVelocity(FLOAT &pressure, FLOAT* const velocity, int i, int j, int k);
virtual ~FlowField ();
};
#endif