Commit 9d5c7e97 authored by frey_m's avatar frey_m
Browse files

SAAMG: do not pass bunch to resizeMesh

parent 0cb6a304
...@@ -442,7 +442,7 @@ void PartBunch::resizeMesh() { ...@@ -442,7 +442,7 @@ void PartBunch::resizeMesh() {
Vector_t origin = Vector_t(0.0, 0.0, 0.0); Vector_t origin = Vector_t(0.0, 0.0, 0.0);
// update the mesh origin and mesh spacing hr_m // update the mesh origin and mesh spacing hr_m
fs_m->solver_m->resizeMesh(origin, hr_m, this); fs_m->solver_m->resizeMesh(origin, hr_m, rmin_m, rmax_m, dh_m);
getMesh().set_meshSpacing(&(hr_m[0])); getMesh().set_meshSpacing(&(hr_m[0]));
getMesh().set_origin(origin); getMesh().set_origin(origin);
......
...@@ -242,8 +242,6 @@ public: ...@@ -242,8 +242,6 @@ public:
virtual void set_meshEnlargement(double dh); virtual void set_meshEnlargement(double dh);
double getMeshEnlargement() const;
void gatherLoadBalanceStatistics(); void gatherLoadBalanceStatistics();
size_t getLoadBalance(int p) const; size_t getLoadBalance(int p) const;
...@@ -511,10 +509,6 @@ public: ...@@ -511,10 +509,6 @@ public:
// get 2nd order momentum matrix // get 2nd order momentum matrix
FMatrix<double, 2 * Dim, 2 * Dim> getSigmaMatrix(); FMatrix<double, 2 * Dim, 2 * Dim> getSigmaMatrix();
const Vector_t& getLowerBound() const;
const Vector_t& getUpperBound() const;
private: private:
// save particles in case of one core // save particles in case of one core
std::unique_ptr<Inform> pmsg_m; std::unique_ptr<Inform> pmsg_m;
......
...@@ -1194,12 +1194,6 @@ void PartBunchBase<T, Dim>::set_meshEnlargement(double dh) { ...@@ -1194,12 +1194,6 @@ void PartBunchBase<T, Dim>::set_meshEnlargement(double dh) {
} }
template <class T, unsigned Dim>
double PartBunchBase<T, Dim>::getMeshEnlargement() const {
return dh_m;
}
template <class T, unsigned Dim> template <class T, unsigned Dim>
void PartBunchBase<T, Dim>::gatherLoadBalanceStatistics() { void PartBunchBase<T, Dim>::gatherLoadBalanceStatistics() {
...@@ -2284,14 +2278,4 @@ FMatrix<double, 2 * Dim, 2 * Dim> PartBunchBase<T, Dim>::getSigmaMatrix() { ...@@ -2284,14 +2278,4 @@ FMatrix<double, 2 * Dim, 2 * Dim> PartBunchBase<T, Dim>::getSigmaMatrix() {
} }
template <class T, unsigned Dim>
const Vector_t& PartBunchBase<T, Dim>::getLowerBound() const {
return rmin_m;
}
template <class T, unsigned Dim>
const Vector_t& PartBunchBase<T, Dim>::getUpperBound() const {
return rmax_m;
}
#endif #endif
\ No newline at end of file
...@@ -161,13 +161,11 @@ void EllipticDomain::compute(Vector_t hr, NDIndex<3> localId){ ...@@ -161,13 +161,11 @@ void EllipticDomain::compute(Vector_t hr, NDIndex<3> localId){
} }
} }
void EllipticDomain::resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* bunch) { void EllipticDomain::resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
Vector_t rmin = bunch->getLowerBound(); const Vector_t& rmax, double dh)
Vector_t rmax = bunch->getUpperBound(); {
Vector_t mymax = Vector_t(0.0, 0.0, 0.0); Vector_t mymax = Vector_t(0.0, 0.0, 0.0);
double dh = bunch->getMeshEnlargement();
// apply bounding box increment, i.e., "BBOXINCR" input argument // apply bounding box increment, i.e., "BBOXINCR" input argument
double zmin = std::signbit(rmin[2]) ? rmin[2] * (1.0 + dh) : rmin[2] * (1.0 - dh); double zmin = std::signbit(rmin[2]) ? rmin[2] * (1.0 + dh) : rmin[2] * (1.0 - dh);
double zmax = std::signbit(rmax[2]) ? rmax[2] * (1.0 - dh) : rmax[2] * (1.0 + dh); double zmax = std::signbit(rmax[2]) ? rmax[2] * (1.0 - dh) : rmax[2] * (1.0 + dh);
...@@ -176,7 +174,7 @@ void EllipticDomain::resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<do ...@@ -176,7 +174,7 @@ void EllipticDomain::resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<do
mymax = Vector_t( semiMajor_m, semiMinor_m, zmax); mymax = Vector_t( semiMajor_m, semiMinor_m, zmax);
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
hr[i] = (mymax[i] - origin[i]) / nr[i]; hr[i] = (mymax[i] - origin[i]) / nr[i];
} }
void EllipticDomain::getBoundaryStencil(int x, int y, int z, double &W, void EllipticDomain::getBoundaryStencil(int x, int y, int z, double &W,
......
...@@ -100,7 +100,8 @@ public: ...@@ -100,7 +100,8 @@ public:
bool hasGeometryChanged() { return hasGeometryChanged_m; } bool hasGeometryChanged() { return hasGeometryChanged_m; }
void resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* bunch); void resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
const Vector_t& rmax, double dh);
private: private:
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <string> #include <string>
#include "Algorithms/PBunchDefs.h" #include "Algorithms/PBunchDefs.h"
#include "Algorithms/Quaternion.h" #include "Algorithms/Quaternion.h"
#include "Algorithms/PartBunchBase.h"
/// enumeration corresponding to different interpolation methods at the boundary /// enumeration corresponding to different interpolation methods at the boundary
enum { enum {
...@@ -128,7 +127,8 @@ public: ...@@ -128,7 +127,8 @@ public:
virtual ~IrregularDomain() {}; virtual ~IrregularDomain() {};
// FIXME The function body should be implemented in derived classes. // FIXME The function body should be implemented in derived classes.
virtual void resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* /*bunch*/) { virtual void resizeMesh(Vector_t& origin, Vector_t& hr,
const Vector_t& /*rmin*/, const Vector_t& /*rmax*/, double /*dh*/) {
double xmin = getXRangeMin(); double xmin = getXRangeMin();
double xmax = getXRangeMax(); double xmax = getXRangeMax();
double ymin = getYRangeMin(); double ymin = getYRangeMin();
......
...@@ -123,8 +123,10 @@ public: ...@@ -123,8 +123,10 @@ public:
void extrapolateLHS(); void extrapolateLHS();
void resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* bunch) { void resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
bp_m->resizeMesh(origin, hr, bunch); const Vector_t& rmax, double dh)
{
bp_m->resizeMesh(origin, hr, rmin, rmax, dh);
} }
Inform &print(Inform &os) const; Inform &print(Inform &os) const;
......
...@@ -58,7 +58,10 @@ public: ...@@ -58,7 +58,10 @@ public:
virtual void test(PartBunchBase<double, 3> *bunch) = 0 ; virtual void test(PartBunchBase<double, 3> *bunch) = 0 ;
virtual ~PoissonSolver(){}; virtual ~PoissonSolver(){};
virtual void resizeMesh(Vector_t& /*origin*/, Vector_t& /*hr*/, PartBunchBase<double, 3>* /*bunch*/) { }; virtual void resizeMesh(Vector_t& /*origin*/, Vector_t& /*hr*/,
const Vector_t& /*rmin*/, const Vector_t& /*rmax*/,
double /*dh*/)
{ };
}; };
......
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