-
-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathVelocityGradient.H
50 lines (37 loc) · 1.34 KB
/
VelocityGradient.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
#ifndef FF_VELOCITY_GRADIENT_H
#define FF_VELOCITY_GRADIENT_H
#include "CouplingDataUser.H"
#include "fvCFD.H"
namespace preciceAdapter
{
namespace FF
{
//- Class that writes and reads velocity
class VelocityGradient : public CouplingDataUser
{
private:
//- Velocity field
Foam::volVectorField* U_;
public:
//- Constructor
VelocityGradient(
const Foam::fvMesh& mesh,
const std::string nameU);
//- Write the velocity gradient values into the buffer
std::size_t write(double* buffer, bool meshConnectivity, const unsigned int dim) final;
//- Read the velocity gradient values from the buffer
void read(double* buffer, const unsigned int dim) final;
bool isLocationTypeSupported(const bool meshConnectivity) const final;
//- Get the name of the current data field
std::string getDataName() const final;
};
}
}
// NOTE: In order to couple another variable, you need to add another
// subclass of the CouplingDataUser. Take this file and Velocity.C
// as an example and look for more notes in the Adapter.C and Adapter.H.
// Essentially, the new class needs to implement a constructor (which also
// sets the dataType_) and implement the write() and read() methods.
// Then, you need to create objects of this class in the Adapter.C,
// whenever requested from the configuration file (see notes).
#endif