Commit 3e4d8c47 authored by frey_m's avatar frey_m

SAAMG: remove unused function 'compute'

parent c4fda3de
......@@ -71,142 +71,6 @@ ArbitraryDomain::~ArbitraryDomain() {
//nothing so far
}
void ArbitraryDomain::compute(Vector_t hr){
setHr(hr);
globalMeanR_m = getGlobalMeanR();
globalToLocalQuaternion_m = getGlobalToLocalQuaternion();
localToGlobalQuaternion_m[0] = globalToLocalQuaternion_m[0];
for (int i=1; i<4; i++)
localToGlobalQuaternion_m[i] = -globalToLocalQuaternion_m[i];
hasGeometryChanged_m = true;
IntersectLoX.clear();
IntersectHiX.clear();
IntersectLoY.clear();
IntersectHiY.clear();
IntersectLoZ.clear();
IntersectHiZ.clear();
//calculate intersection
Vector_t P, saveP, dir, I;
//Reference Point
Vector_t P0 = geomCentroid_m;
for (int idz = 0; idz < nr[2] ; idz++) {
saveP[2] = (idz - (nr[2]-1)/2.0)*hr[2];
for (int idy = 0; idy < nr[1] ; idy++) {
saveP[1] = (idy - (nr[1]-1)/2.0)*hr[1];
for (int idx = 0; idx <nr[0]; idx++) {
saveP[0] = (idx - (nr[0]-1)/2.0)*hr[0];
P = saveP;
rotateWithQuaternion(P, localToGlobalQuaternion_m);
P += geomCentroid_m;
if (bgeom_m->fastIsInside(P0, P) % 2 == 0) {
P0 = P;
std::tuple<int, int, int> pos(idx, idy, idz);
rotateZAxisWithQuaternion(dir, localToGlobalQuaternion_m);
if (bgeom_m->intersectRayBoundary(P, dir, I)) {
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiZ.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "zdir=+1 " << dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
if (bgeom_m->intersectRayBoundary(P, -dir, I)) {
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoZ.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[2]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "zdir=-1 " << -dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
rotateYAxisWithQuaternion(dir, localToGlobalQuaternion_m);
if (bgeom_m->intersectRayBoundary(P, dir, I)) {
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiY.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "ydir=+1 " << dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
if (bgeom_m->intersectRayBoundary(P, -dir, I)) {
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoY.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[1]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "ydir=-1" << -dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
rotateXAxisWithQuaternion(dir, localToGlobalQuaternion_m);
if (bgeom_m->intersectRayBoundary(P, dir, I)) {
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectHiX.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "xdir=+1 " << dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
if (bgeom_m->intersectRayBoundary(P, -dir, I)){
I -= geomCentroid_m;
rotateWithQuaternion(I, globalToLocalQuaternion_m);
IntersectLoX.insert(std::pair< std::tuple<int, int, int>, double >(pos, I[0]));
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "xdir=-1 " << -dir << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
} else {
#ifdef DEBUG_INTERSECT_RAY_BOUNDARY
*gmsg << "OUTSIDE" << " x,y,z= " << idx << "," << idy
<< "," << idz << " P=" << P <<" I=" << I << endl;
#endif
}
}
}
}
IdxMap.clear();
CoordMap.clear();
int id=0;
int idx, idy, idz;
for (idz = 0; idz < nr[2]; idz++) {
for (idy = 0; idy < nr[1]; idy++) {
for (idx = 0; idx < nr[0]; idx++) {
if (isInside(idx, idy, idz)) {
IdxMap[toCoordIdx(idx, idy, idz)] = id;
CoordMap[id] = toCoordIdx(idx, idy, idz);
id++;
}
}
}
}
}
void ArbitraryDomain::compute(Vector_t hr, NDIndex<3> localId){
INFOMSG(level2 << "* Starting the Boundary Intersection Tests..." << endl);
......
......@@ -76,8 +76,6 @@ public:
bool isInside(int idx, int idy, int idz);
/// returns number of nodes in xy plane
int getNumXY(int idz);
// calculates intersection
void compute(Vector_t hr);
// calculates intersection with rotated and shifted geometry
void compute(Vector_t hr, NDIndex<3> localId);
......
......@@ -79,7 +79,7 @@ BoxCornerDomain::~BoxCornerDomain() {
// for the moment we center the box corner geometry around the center of the grid
// hr holds the grid-spacings (boundary ellipse embedded in hr-grid)
void BoxCornerDomain::compute(Vector_t hr){
void BoxCornerDomain::compute(Vector_t hr, NDIndex<3> /*localId*/){
//there is nothing to be done if the mesh spacings have not changed
// if(hr[0] == getHr()[0] && hr[1] == getHr()[1] && hr[2] == getHr()[2]) {
......@@ -154,8 +154,6 @@ void BoxCornerDomain::compute(Vector_t hr){
*/
}
void BoxCornerDomain::compute(Vector_t /*hr*/, NDIndex<3> /*localId*/){
}
void BoxCornerDomain::getBoundaryStencil(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B, double &C, double &scaleFactor) {
......
......@@ -118,7 +118,6 @@ public:
/// set semi-major
//void setSemiMajor(double sm) {SemiMajor = sm;}
void compute(Vector_t hr);
void compute(Vector_t hr, NDIndex<3> localId);
double getXRangeMin() { return -A_m; }
......
......@@ -88,10 +88,6 @@ public:
/// calculates intersection
void compute(Vector_t /*hr*/) {
throw OpalException("EllipticDomain::compute()", "This function is not available.");
}
void compute(Vector_t hr, NDIndex<3> localId);
double getXRangeMin() { return -semiMajor_m; }
......
......@@ -47,7 +47,6 @@ public:
* (stored in some appropriate data structure)
* \param hr updated mesh spacings
*/
virtual void compute(Vector_t hr) = 0;
virtual void compute(Vector_t hr, NDIndex<3> localId) = 0;
/** method to get the number of gridpoints in a given z plane
* \param z coordinate of the z plane
......
......@@ -126,7 +126,7 @@ MGPoissonSolver::MGPoissonSolver ( PartBunch *beam,
currentGeometry->getL1(),
currentGeometry->getL2(),
orig_nr_m, hr_m, interpl));
bp_m->compute(itsBunch_m->get_hr());
bp_m->compute(itsBunch_m->get_hr(), layout_m->getLocalNDIndex());
} else {
throw OpalException("MGPoissonSolver::MGPoissonSolver",
"Geometry not known");
......
......@@ -44,7 +44,7 @@ RectangularDomain::RectangularDomain(double a, double b, Vector_t nr, Vector_t h
nxy_m = nr[0] * nr[1];
}
void RectangularDomain::compute(Vector_t hr){
void RectangularDomain::compute(Vector_t hr, NDIndex<3> /*localId*/){
setHr(hr);
nxy_m = nr[0] * nr[1];
}
......
......@@ -40,7 +40,7 @@ public:
RectangularDomain(double a, double b, Vector_t nr, Vector_t hr);
/// calculates intersection with the beam pipe
void compute(Vector_t hr);
void compute(Vector_t hr, NDIndex<3> /*localId*/);
/// returns number of nodes in xy plane (here independent of z coordinate)
int getNumXY(int z);
......
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