Commit 386c405f authored by Kaman Tülin's avatar Kaman Tülin

The bunch offsets are taken into account; linear interpolation is implemented...

The bunch offsets are taken into account; linear interpolation is implemented in fieldsolver when using H5 geometry
parent 76555b90
This diff is collapsed.
......@@ -47,18 +47,21 @@ public:
int getStartId() {return startId;}
double getXRangeMin(){ return intersectMinCoords_m(0); }
double getXRangeMax(){ return intersectMaxCoords_m(0); }
double getYRangeMin(){ return intersectMinCoords_m(1); }
double getYRangeMax(){ return intersectMaxCoords_m(1); }
double getZRangeMin(){ return intersectMinCoords_m(2); }
double getZRangeMax(){ return intersectMaxCoords_m(2); }
void setXRangeMin(double xmin){ intersectMinCoords_m(0) = xmin; }
void setXRangeMax(double xmax){ intersectMaxCoords_m(0) = xmax; }
void setYRangeMin(double ymin){ intersectMinCoords_m(1) = ymin; }
void setYRangeMax(double ymax){ intersectMaxCoords_m(1) = ymax; }
void setZRangeMin(double zmin){ intersectMinCoords_m(2) = zmin; }
void setZRangeMax(double zmax){ intersectMaxCoords_m(2) = zmax; }
double getXRangeMin(){ return minCoords_m(0); }
double getYRangeMin(){ return minCoords_m(1); }
double getZRangeMin(){ return minCoords_m(2); }
double getXRangeMax(){ return maxCoords_m(0); }
double getYRangeMax(){ return maxCoords_m(1); }
double getZRangeMax(){ return maxCoords_m(2); }
void setXRangeMin(double xmin){ minCoords_m(0) = xmin; }
void setYRangeMin(double ymin){ minCoords_m(1) = ymin; }
void setZRangeMin(double zmin){ minCoords_m(2) = zmin; }
void setXRangeMax(double xmax){ maxCoords_m(0) = xmax; }
void setYRangeMax(double ymax){ maxCoords_m(1) = ymax; }
void setZRangeMax(double zmax){ maxCoords_m(2) = zmax; }
bool hasGeometryChanged() { return hasGeometryChanged_m; }
......@@ -83,6 +86,7 @@ private:
Vektor<double, 4> globalToLocalQuaternion_m;
Vektor<double, 4> localToGlobalQuaternion_m;
Vector_t globalMinR_m;
int startId;
// Here we store the number of nodes in a xy layer for a given z coordinate
......@@ -104,10 +108,8 @@ private:
Vector_t Geo_nr_m;
Vector_t Geo_hr_m;
Vector_t Geo_mincoords_m;
Vector_t Geo_maxcoords_m;
Vector_t intersectMinCoords_m;
Vector_t intersectMaxCoords_m;
Vector_t minCoords_m;
Vector_t maxCoords_m;
// Conversion from (x,y,z) to index in xyz plane
inline int toCoordIdx(int idx, int idy, int idz);
......
......@@ -88,6 +88,12 @@ public:
double getMinZ() { return zMin_m; }
double getMaxZ() { return zMax_m; }
void setCentroid(Vector_t rmean) { rMean_m = rmean;}
Vector_t getCentroid() { return rMean_m; }
void setOrigin(Vector_t rmin) { rMin_m = rmin;}
Vector_t getOrigin() { return rMin_m; }
virtual double getXRangeMin() = 0;
virtual double getXRangeMax() = 0;
virtual double getYRangeMin() = 0;
......@@ -109,6 +115,11 @@ protected:
/// min/max of bunch in floor coordinates
double zMin_m;
double zMax_m;
/// mean position of bunch (m)
Vector_t rMean_m;
/// min position of the bunch
Vector_t rMin_m;
};
#endif //#ifdef HAVE_SAAMG_SOLVER
......
......@@ -256,6 +256,8 @@ void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
nr_m[2] = orig_nr_m[2];
//bp->setMinMaxZ(itsBunch_m->get_origin()[2], itsBunch_m->get_maxExtend()[2]);
bp->setCentroid(itsBunch_m->get_centroid());
bp->setOrigin(itsBunch_m->get_origin());
bp->setNr(nr_m);
NDIndex<3> localId = layout_m->getLocalNDIndex();
......@@ -457,9 +459,7 @@ void MGPoissonSolver::IPPLToMap3D(NDIndex<3> localId) {
void MGPoissonSolver::IPPLToMap3DGeo(NDIndex<3> localId) {
int NumMyElements = 0;
std::vector<int> MyGlobalElements;
/* std::cout << Ippl::myNode() << " In IPPLToMap3DGeo localId: " << localId[0].first() << " " << localId[0].last() << "\n"
<< localId[1].first() << " " << localId[1].last() << "\n"
<< localId[2].first() << " " << localId[2].last() << std::endl; */
for (int idz = localId[2].first(); idz <= localId[2].last(); idz++) {
for (int idy = localId[1].first(); idy <= localId[1].last(); idy++) {
for (int idx = localId[0].first(); idx <= localId[0].last(); idx++) {
......@@ -489,7 +489,7 @@ void MGPoissonSolver::ComputeStencil(Vector_t hr, Teuchos::RCP<Epetra_Vector> RH
int W, E, S, N, F, B;
bp->getBoundaryStencil(MyGlobalElements[i], WV, EV, SV, NV, FV, BV, CV, scaleFactor);
// RHS->Values()[i] *= scaleFactor;
RHS->Values()[i] *= scaleFactor;
bp->getNeighbours(MyGlobalElements[i], W, E, S, N, F, B);
if(E != -1) {
......
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