Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit d131d96e authored by frey_m's avatar frey_m
Browse files

RectangularDomain: fix resizeMesh + isInside

parent d8f1cd5f
No related branches found
No related tags found
1 merge request!372Resolve "SAAMG: Enable RectangularDomain"
......@@ -152,19 +152,16 @@ void RectangularDomain::getNeighbours(int x, int y, int z, double &W, double &E,
B = -1;
}
void RectangularDomain::resizeMesh(Vector_t& origin, Vector_t& hr, PartBunchBase<double, 3>* bunch) {
Vector_t rmin = bunch->getLowerBound();
Vector_t rmax = bunch->getUpperBound();
Vector_t mymax = Vector_t(0.0, 0.0, 0.0);
double dh = bunch->getMeshEnlargement();
void RectangularDomain::resizeMesh(Vector_t& origin, Vector_t& hr, const Vector_t& rmin,
const Vector_t& rmax, double dh)
{
// 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);
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, zmin);
mymax = Vector_t( a_m, b_m, zmax);
origin = Vector_t(-a_m, -b_m, this->zMin_m);
mymax = Vector_t( a_m, b_m, this->zMax_m);
for (int i = 0; i < 3; ++i)
hr[i] = (mymax[i] - origin[i]) / nr[i];
......
......@@ -30,7 +30,6 @@
#include <vector>
#include <string>
#include "IrregularDomain.h"
#include "PartBunchBase.h"
class RectangularDomain : public IrregularDomain {
......@@ -68,16 +67,18 @@ public:
void getNeighbours(int idx, double &W, double &E, double &S,
double &N, double &F, double &B);
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);
/// returns type of boundary condition
std::string getType() {return "Rectangular";}
/// queries if a given (x,y,z) coordinate lies inside the domain
inline bool isInside(int x, int y, int /*z*/) {
double xx = (x - (nr[0] - 1) / 2.0) * hr[0];
double yy = (y - (nr[1] - 1) / 2.0) * hr[1];
return (xx <= a_m && yy < b_m);
return true;
// double xx = - a_m + hr[0] * (x + 0.5);
// double yy = - b_m + hr[1] * (y + 0.5);
// return (xx <= a_m && yy < b_m);
}
void setB_m(double b) {b_m = b;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment