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() {
Vector_t origin = Vector_t(0.0, 0.0, 0.0);
// 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_origin(origin);
......
......@@ -242,8 +242,6 @@ public:
virtual void set_meshEnlargement(double dh);
double getMeshEnlargement() const;
void gatherLoadBalanceStatistics();
size_t getLoadBalance(int p) const;
......@@ -511,10 +509,6 @@ public:
// get 2nd order momentum matrix
FMatrix<double, 2 * Dim, 2 * Dim> getSigmaMatrix();
const Vector_t& getLowerBound() const;
const Vector_t& getUpperBound() const;
private:
// save particles in case of one core
std::unique_ptr<Inform> pmsg_m;
......
......@@ -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>
void PartBunchBase<T, Dim>::gatherLoadBalanceStatistics() {
......@@ -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
\ No newline at end of file
......@@ -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) {
Vector_t rmin = bunch->getLowerBound();
Vector_t rmax = bunch->getUpperBound();
void EllipticDomain::resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
const Vector_t& rmax, double dh)
{
Vector_t mymax = Vector_t(0.0, 0.0, 0.0);
double dh = bunch->getMeshEnlargement();
// 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 zmax = std::signbit(rmax[2]) ? rmax[2] * (1.0 - dh) : rmax[2] * (1.0 + dh);
......
......@@ -100,7 +100,8 @@ public:
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:
......
......@@ -27,7 +27,6 @@
#include <string>
#include "Algorithms/PBunchDefs.h"
#include "Algorithms/Quaternion.h"
#include "Algorithms/PartBunchBase.h"
/// enumeration corresponding to different interpolation methods at the boundary
enum {
......@@ -128,7 +127,8 @@ public:
virtual ~IrregularDomain() {};
// 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 xmax = getXRangeMax();
double ymin = getYRangeMin();
......
......@@ -123,8 +123,10 @@ public:
void extrapolateLHS();
void resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* bunch) {
bp_m->resizeMesh(origin, hr, bunch);
void resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
const Vector_t& rmax, double dh)
{
bp_m->resizeMesh(origin, hr, rmin, rmax, dh);
}
Inform &print(Inform &os) const;
......
......@@ -58,7 +58,10 @@ public:
virtual void test(PartBunchBase<double, 3> *bunch) = 0 ;
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