Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit b2bef3f8 authored by frey_m's avatar frey_m
Browse files

ArbitraryDomain: apply coding style to intersection variables

parent d58d6224
No related branches found
No related tags found
1 merge request!396Resolve "Code duplication in Domains"
...@@ -75,12 +75,12 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -75,12 +75,12 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
hasGeometryChanged_m = true; hasGeometryChanged_m = true;
IntersectLoX.clear(); intersectLoX_m.clear();
IntersectHiX.clear(); intersectHiX_m.clear();
IntersectLoY.clear(); intersectLoY_m.clear();
IntersectHiY.clear(); intersectHiY_m.clear();
IntersectLoZ.clear(); intersectLoZ_m.clear();
IntersectHiZ.clear(); intersectHiZ_m.clear();
// Calculate intersection // Calculate intersection
Vector_t P, dir, I; Vector_t P, dir, I;
...@@ -119,7 +119,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -119,7 +119,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
dir = Vector_t(0, 0, 1); dir = Vector_t(0, 0, 1);
if (bgeom_m->intersectRayBoundary(P, dir, I)) { if (bgeom_m->intersectRayBoundary(P, dir, I)) {
IntersectHiZ.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2])); intersectHiZ_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "zdir=+1 " << dir << " x,y,z= " << idx << "," << idy *gmsg << "zdir=+1 " << dir << " x,y,z= " << idx << "," << idy
...@@ -128,7 +128,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -128,7 +128,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
} }
if (bgeom_m->intersectRayBoundary(P, -dir, I)) { if (bgeom_m->intersectRayBoundary(P, -dir, I)) {
IntersectLoZ.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2])); intersectLoZ_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "zdir=-1 " << -dir << " x,y,z= " << idx << "," << idy *gmsg << "zdir=-1 " << -dir << " x,y,z= " << idx << "," << idy
...@@ -139,7 +139,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -139,7 +139,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
dir = Vector_t(0, 1, 0); dir = Vector_t(0, 1, 0);
if (bgeom_m->intersectRayBoundary(P, dir, I)) { if (bgeom_m->intersectRayBoundary(P, dir, I)) {
IntersectHiY.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1])); intersectHiY_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "ydir=+1 " << dir << " x,y,z= " << idx << "," << idy *gmsg << "ydir=+1 " << dir << " x,y,z= " << idx << "," << idy
...@@ -148,7 +148,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -148,7 +148,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
} }
if (bgeom_m->intersectRayBoundary(P, -dir, I)) { if (bgeom_m->intersectRayBoundary(P, -dir, I)) {
IntersectLoY.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1])); intersectLoY_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "ydir=-1" << -dir << " x,y,z= " << idx << "," << idy *gmsg << "ydir=-1" << -dir << " x,y,z= " << idx << "," << idy
...@@ -159,7 +159,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -159,7 +159,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
dir = Vector_t(1, 0, 0); dir = Vector_t(1, 0, 0);
if (bgeom_m->intersectRayBoundary(P, dir, I)) { if (bgeom_m->intersectRayBoundary(P, dir, I)) {
IntersectHiX.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0])); intersectHiX_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "xdir=+1 " << dir << " x,y,z= " << idx << "," << idy *gmsg << "xdir=+1 " << dir << " x,y,z= " << idx << "," << idy
...@@ -168,7 +168,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -168,7 +168,7 @@ void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
} }
if (bgeom_m->intersectRayBoundary(P, -dir, I)){ if (bgeom_m->intersectRayBoundary(P, -dir, I)){
IntersectLoX.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0])); intersectLoX_m.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0]));
} else { } else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY #ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "xdir=-1 " << -dir << " x,y,z= " << idx << "," << idy *gmsg << "xdir=-1 " << -dir << " x,y,z= " << idx << "," << idy
...@@ -323,17 +323,17 @@ void ArbitraryDomain::linearInterpolation(int idx, int idy, int idz, ...@@ -323,17 +323,17 @@ void ArbitraryDomain::linearInterpolation(int idx, int idy, int idz,
std::tuple<int, int, int> coordxyz(idx, idy, idz); std::tuple<int, int, int> coordxyz(idx, idy, idz);
if (idx == nr_m[0]-1) if (idx == nr_m[0]-1)
dx_e = std::abs(IntersectHiX.find(coordxyz)->second - cx); dx_e = std::abs(intersectHiX_m.find(coordxyz)->second - cx);
if (idx == 0) if (idx == 0)
dx_w = std::abs(IntersectLoX.find(coordxyz)->second - cx); dx_w = std::abs(intersectLoX_m.find(coordxyz)->second - cx);
if (idy == nr_m[1]-1) if (idy == nr_m[1]-1)
dy_n = std::abs(IntersectHiY.find(coordxyz)->second - cy); dy_n = std::abs(intersectHiY_m.find(coordxyz)->second - cy);
if (idy == 0) if (idy == 0)
dy_s = std::abs(IntersectLoY.find(coordxyz)->second - cy); dy_s = std::abs(intersectLoY_m.find(coordxyz)->second - cy);
if (idz == nr_m[2]-1) if (idz == nr_m[2]-1)
dz_b = std::abs(IntersectHiZ.find(coordxyz)->second - cz); dz_b = std::abs(intersectHiZ_m.find(coordxyz)->second - cz);
if (idz == 0) if (idz == 0)
dz_f = std::abs(IntersectLoZ.find(coordxyz)->second - cz); dz_f = std::abs(intersectLoZ_m.find(coordxyz)->second - cz);
if(dx_w != 0) if(dx_w != 0)
value.west = -(dz_f + dz_b) * (dy_n + dy_s) / dx_w; value.west = -(dz_f + dz_b) * (dy_n + dy_s) / dx_w;
......
...@@ -61,19 +61,19 @@ public: ...@@ -61,19 +61,19 @@ public:
private: private:
BoundaryGeometry *bgeom_m; BoundaryGeometry *bgeom_m;
/** PointList maps from an (x,z) resp. (y,z) pair to double values /** PointList_t maps from an (x,z) resp. (y,z) pair to double values
* (=intersections with boundary) * (=intersections with boundary)
*/ */
typedef std::multimap< std::tuple<int, int, int>, double > PointList; typedef std::multimap< std::tuple<int, int, int>, double > PointList_t;
/// all intersection points with gridlines in X direction /// all intersection points with gridlines in X direction
PointList IntersectHiX, IntersectLoX; PointList_t intersectHiX_m, intersectLoX_m;
/// all intersection points with gridlines in Y direction /// all intersection points with gridlines in Y direction
PointList IntersectHiY, IntersectLoY; PointList_t intersectHiY_m, intersectLoY_m;
/// all intersection points with gridlines in Z direction /// all intersection points with gridlines in Z direction
PointList IntersectHiZ, IntersectLoZ; PointList_t intersectHiZ_m, intersectLoZ_m;
// Here we store the number of nodes in a xy layer for a given z coordinate // Here we store the number of nodes in a xy layer for a given z coordinate
std::map<int, int> numXY; std::map<int, int> numXY;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment