forked from arpans16/openfoam-adapter-volCoup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCouplingDataUser.H
69 lines (48 loc) · 1.4 KB
/
CouplingDataUser.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
#ifndef COUPLINGDATAUSER_H
#define COUPLINGDATAUSER_H
#include <vector>
#include <string>
namespace preciceAdapter
{
class CouplingDataUser
{
protected:
enum DataType
{
scalar,
vector
};
//- Type of the coupling data (scalar or vector)
DataType dataType_ = scalar;
//- OpenFOAM patches that form the interface
std::vector<int> patchIDs_;
//- preCICE data ID
int dataID_;
//- location type of the interface
std::string locationsType_;
public:
//- Constructor
CouplingDataUser();
//- Returns true if the data are scalar
bool hasScalarData();
//- Returns true if the data are vector
bool hasVectorData();
//- Set the preCICE data ID
void setDataID(int dataID);
//- Get the preCICE data ID
int dataID();
//- Set the patch IDs that form the interface
void setPatchIDs(std::vector<int> patchIDs);
//- Set the locations type of the interface
void setLocationsType(std::string locationsType);
//- option to initialize data in derived data classes
virtual void initialize();
//- Write the coupling data to the buffer
virtual void write(double* dataBuffer, bool meshConnectivity, const unsigned int dim) = 0;
//- Read the coupling data from the buffer
virtual void read(double* dataBuffer, const unsigned int dim) = 0;
//- Destructor
virtual ~CouplingDataUser() {}
};
}
#endif