1 #ifndef ARBITRARY_DOMAIN_H
2 #define ARBITRARY_DOMAIN_H
4 #ifdef HAVE_SAAMG_SOLVER
18 class ArbitraryDomain :
public IrregularDomain {
28 void getBoundaryStencil(
int idx,
int idy,
int idz,
double &
W,
double &E,
double &S,
double &N,
double &F,
double &B,
double &C,
double &scaleFactor);
30 void getBoundaryStencil(
int idxyz,
double &
W,
double &E,
double &S,
double &N,
double &F,
double &B,
double &C,
double &scaleFactor);
32 void getNeighbours(
int idx,
int idy,
int idz,
int &
W,
int &E,
int &S,
int &N,
int &F,
int &B);
34 void getNeighbours(
int idxyz,
int &
W,
int &E,
int &S,
int &N,
int &F,
int &B);
36 std::string getType() {
return "Geometric";}
38 bool isInside(
int idx,
int idy,
int idz);
40 int getNumXY(
int idz);
46 int getStartId() {
return startId;}
48 double getXRangeMin(){
return minCoords_m(0); }
49 double getYRangeMin(){
return minCoords_m(1); }
50 double getZRangeMin(){
return minCoords_m(2); }
52 double getXRangeMax(){
return maxCoords_m(0); }
53 double getYRangeMax(){
return maxCoords_m(1); }
54 double getZRangeMax(){
return maxCoords_m(2); }
56 void setXRangeMin(
double xmin){ minCoords_m(0) = xmin; }
57 void setYRangeMin(
double ymin){ minCoords_m(1) = ymin; }
58 void setZRangeMin(
double zmin){ minCoords_m(2) = zmin; }
60 void setXRangeMax(
double xmax){ maxCoords_m(0) = xmax; }
61 void setYRangeMax(
double ymax){ maxCoords_m(1) = ymax; }
62 void setZRangeMax(
double zmax){ maxCoords_m(2) = zmax; }
65 bool hasGeometryChanged() {
return hasGeometryChanged_m; }
71 typedef std::multimap< std::tuple<int, int, int>,
double > PointList;
74 PointList IntersectHiX, IntersectLoX;
77 PointList IntersectHiY, IntersectLoY;
80 PointList IntersectHiZ, IntersectLoZ;
90 std::map<int, int> numXY;
91 std::map<int, int> numYZ;
92 std::map<int, int> numXZ;
97 std::map<int, int> IdxMap;
99 std::map<int, int> CoordMap;
102 std::map<int, bool> IsInsideMap;
105 int interpolationMethod;
108 bool hasGeometryChanged_m;
118 inline int toCoordIdx(
int idx,
int idy,
int idz);
120 int getIdx(
int idx,
int idy,
int idz);
122 inline void getCoord(
int idxyz,
int &x,
int &y,
int &z);
124 inline void crossProduct(
double A[],
double B[],
double C[]);
125 inline double dotProduct(
double v1[],
double v2[]) {
return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]); }
128 void constantInterpolation(
int idx,
int idy,
int idz,
double &
W,
double &E,
double &S,
double &N,
double &F,
double &B,
double &C,
double &scaleFactor);
129 void linearInterpolation(
int idx,
int idy,
int idz,
double &
W,
double &E,
double &S,
double &N,
double &F,
double &B,
double &C,
double &scaleFactor);
130 void quadraticInterpolation(
int idx,
int idy,
int idz,
double &
W,
double &E,
double &S,
double &N,
double &F,
double &B,
double &C,
double &scaleFactor);
140 #endif //#ifdef HAVE_SAAMG_SOLVER
141 #endif //#ifdef ARBITRARY_DOMAIN
double dotProduct(const Vector_t &a, const Vector_t &b)