Commit b6b06cb5 authored by frey_m's avatar frey_m
Browse files

SAAMG: use functions

parent c9b91a74
......@@ -91,15 +91,15 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
// example (-0.13 to +0.025). -DW
for (int idz = localId[2].first()-zGhostOffsetLeft; idz <= localId[2].last()+zGhostOffsetRight; idz++) {
P[2] = min_m[2] + (idz + 0.5) * hr[2];
P[2] = getZRangeMin() + (idz + 0.5) * hr[2];
for (int idy = localId[1].first()-yGhostOffsetLeft; idy <= localId[1].last()+yGhostOffsetRight; idy++) {
P[1] = min_m[1] + (idy + 0.5) * hr[1];
P[1] = getYRangeMin() + (idy + 0.5) * hr[1];
for (int idx = localId[0].first()-xGhostOffsetLeft; idx <= localId[0].last()+xGhostOffsetRight; idx++) {
P[0] = min_m[0] + (idx + 0.5) * hr[0];
P[0] = getXRangeMin() + (idx + 0.5) * hr[0];
if (bgeom_m->fastIsInside(P0, P) % 2 == 0) {
......
......@@ -65,10 +65,10 @@ Test in which of the 3 parts of the geometry we are in.
b = B-C;
A = max_m(0)
B = max_m(1)
L1 = min_m(2)
L2 = max_m(2) - min_m(2)
A = getXRangeMax()
B = getYRangeMax()
L1 = getZRangeMin()
L2 = getZRangeMax() - getZRangeMin
*/
class BoxCornerDomain : public IrregularDomain {
......@@ -92,10 +92,10 @@ public:
/// as a function of z, determine the hight (B) of the geometry
inline double getB(double z) {
if((z < min_m(2)) || (z > max_m(2)))
return max_m(1);
if((z < getZRangeMin()) || (z > getZRangeMax()))
return getYRangeMax();
else
return max_m(1) - C_m;
return getYRangeMax() - C_m;
}
/// queries if a given (x,y,z) coordinate lies inside the domain
......@@ -137,11 +137,11 @@ private:
inline double getXIntersection(double cx, int /*z*/) {
return (cx < 0) ? min_m(0) : max_m(0);
return (cx < 0) ? getXRangeMin() : getXRangeMax();
}
inline double getYIntersection(double cy, int z) {
return (cy < 0) ? min_m(1) : getB(z * hr_m[2]);
return (cy < 0) ? getYRangeMin() : getB(z * hr_m[2]);
}
/// conversion from (x,y,z) to index in xyz plane
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment