-
Notifications
You must be signed in to change notification settings - Fork 3
/
Patch.hpp
55 lines (47 loc) · 1.61 KB
/
Patch.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
/* This file belongs to the GridPro2FOAM distribution
Developed by Vincent Rivola and Martin Spel
R.Tech SARL
Parc Technologique Cap Delta
09340 Verniolle
France
For contact information: http://www.rtech.fr/contact.html
or email: support@rtech-engineering.com
*/
#ifndef PATCH_HPP
#define PATCH_HPP
#include <string>
#include <stdio.h>
#include "Triplet.hpp"
#include "Block.hpp"
using namespace std;
#define IDIR 0
#define JDIR 1
#define KDIR 2
class Block;
class Patch
{
private:
Block *hostBlock; // number of host block
int hostFace; // face of host block
Block *donorBlock; // number of host block
int donorFace; // face of host block
string orientation; // mapping of host ijk to donor ijk
bool isPeriodic; // true for periodic boundary condition
short periodicSide;
int A[3][3]; // transformation matrix
int BC;
Triplet lowHost, highHost; // two i,j,k triplets to define the region of this patch
Triplet lowDonor, highDonor; // two i,j,k triplets to define the region of this patch
int nrFaces;
public:
Patch(int setBC, Block *setHostBlock, int setSF1, Block *setDonorBlock, string setOrientation, bool setPeriodic=false, short setPeriodicSide=0);
~Patch();
void MakeEdgePointsUnique(); // Makes the points of an interface between two blocks unique
// if a patch has BC 0 we assume it is an internal BC
bool IsInternal() {return BC==0;};
bool IsPeriodic() {return isPeriodic;};
int GetBC() {return BC;};
bool Contains(int direction, int i, int j, int k);
int NrFaces() {return nrFaces;};
};
#endif