From 7b6289bca5fde6f044994c3ec71b25f138134b72 Mon Sep 17 00:00:00 2001 From: Matthias Frey <matthias.frey@psi.ch> Date: Wed, 15 Jul 2020 10:06:00 +0200 Subject: [PATCH] RectangularDomain: Fix compile errors --- src/Solvers/MGPoissonSolver.cpp | 2 +- src/Solvers/RectangularDomain.cpp | 18 ++++++++++-------- src/Solvers/RectangularDomain.h | 14 ++++++++++---- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/Solvers/MGPoissonSolver.cpp b/src/Solvers/MGPoissonSolver.cpp index 14a9d3965..e8cd830b4 100644 --- a/src/Solvers/MGPoissonSolver.cpp +++ b/src/Solvers/MGPoissonSolver.cpp @@ -128,7 +128,7 @@ MGPoissonSolver::MGPoissonSolver ( PartBunch *beam, currentGeometry->getL2(), orig_nr_m, hr_m, interpl)); bp_m->compute(itsBunch_m->get_hr()); - } else if (currentGeometry->getTopology() == "RECTANGULAR") + } else if (currentGeometry->getTopology() == "RECTANGULAR") { bp_m = std::unique_ptr<IrregularDomain>( new RectangularDomain(currentGeometry->getA(), currentGeometry->getB(), diff --git a/src/Solvers/RectangularDomain.cpp b/src/Solvers/RectangularDomain.cpp index 64341a6bc..741d3988c 100644 --- a/src/Solvers/RectangularDomain.cpp +++ b/src/Solvers/RectangularDomain.cpp @@ -106,8 +106,8 @@ void RectangularDomain::getBoundaryStencil(int idx, double &W, double &E, } -void RectangularDomain::getNeighbours(int idx, double &W, double &E, double &S, - double &N, double &F, double &B) +void RectangularDomain::getNeighbours(int idx, int &W, int &E, int &S, + int &N, int &F, int &B) { int x = 0, y = 0, z = 0; @@ -116,8 +116,8 @@ void RectangularDomain::getNeighbours(int idx, double &W, double &E, double &S, } -void RectangularDomain::getNeighbours(int x, int y, int z, double &W, double &E, - double &S, double &N, double &F, double &B) +void RectangularDomain::getNeighbours(int x, int y, int z, int &W, int &E, + int &S, int &N, int &F, int &B) { if (x > 0) W = getIdx(x - 1, y, z); @@ -152,11 +152,13 @@ void RectangularDomain::resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_ { // apply bounding box increment, i.e., "BBOXINCR" input argument double zsize = rmax[2] - rmin[2]; - this->zMin_m = rmin[2] - zsize * (1.0 + dh); - this->zMax_m = rmax[2] + zsize * (1.0 + dh); - origin = Vector_t(-a_m, -b_m, this->zMin_m); - mymax = Vector_t( a_m, b_m, this->zMax_m); + setMinMaxZ(rmin[2] - zsize * (1.0 + dh), + rmax[2] + zsize * (1.0 + dh)); + + origin = Vector_t(-a_m, -b_m, getMinZ()); + + Vector_t mymax = Vector_t(a_m, b_m, getMaxZ()); for (int i = 0; i < 3; ++i) hr[i] = (mymax[i] - origin[i]) / nr[i]; diff --git a/src/Solvers/RectangularDomain.h b/src/Solvers/RectangularDomain.h index 0e599acab..9d4997d38 100644 --- a/src/Solvers/RectangularDomain.h +++ b/src/Solvers/RectangularDomain.h @@ -44,6 +44,10 @@ public: /// calculates intersection with the beam pipe void compute(Vector_t hr); + void compute(Vector_t /*hr*/, NDIndex<3> /*localId*/) { + // we have no intersections + } + /// returns number of nodes in xy plane (here independent of z coordinate) int getNumXY(int z); @@ -60,12 +64,14 @@ public: /// returns index of neighbours at (x,y,z) using IrregularDomain::getNeighbours; - void getNeighbours(int x, int y, int z, double &W, double &E, - double &S, double &N, double &F, double &B); + void getNeighbours(int x, int y, int z, int &W, int &E, + int &S, int &N, int &F, int &B); /// returns index of neighbours at 3D index - void getNeighbours(int idx, double &W, double &E, double &S, - double &N, double &F, double &B); + void getNeighbours(int idx, int &W, int &E, int &S, + int &N, int &F, int &B); + + bool hasGeometryChanged() { return false; } void resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin, const Vector_t& rmax, double dh); -- GitLab