Commit cf1b8bfb authored by frey_m's avatar frey_m

SAAMG: clean up use of interpolationMethod variable

parent 382323d7
......@@ -41,7 +41,7 @@ ArbitraryDomain::ArbitraryDomain( BoundaryGeometry * bgeom,
Vector_t nr,
Vector_t hr,
std::string interpl)
: IrregularDomain(nr, hr)
: IrregularDomain(nr, hr, interpl)
{
bgeom_m = bgeom;
......@@ -58,13 +58,6 @@ ArbitraryDomain::ArbitraryDomain( BoundaryGeometry * bgeom,
}
startId = 0;
if (interpl == "CONSTANT")
interpolationMethod = CONSTANT;
else if(interpl == "LINEAR")
interpolationMethod = LINEAR;
else if(interpl == "QUADRATIC")
interpolationMethod = QUADRATIC;
}
ArbitraryDomain::~ArbitraryDomain() {
......@@ -388,7 +381,7 @@ void ArbitraryDomain::getBoundaryStencil(int idx, int idy, int idz,
{
scaleFactor = 1.0;
// determine which interpolation method we use for points near the boundary
switch(interpolationMethod){
switch(interpolationMethod_m){
case CONSTANT:
constantInterpolation(idx,idy,idz,value,scaleFactor);
break;
......
......@@ -107,9 +107,6 @@ private:
// Mapping all cells that are inside the geometry
std::map<int, bool> IsInsideMap;
// Interpolation type
int interpolationMethod;
Vector_t geomCentroid_m;
Vector_t minCoords_m;
Vector_t maxCoords_m;
......
......@@ -38,20 +38,13 @@ extern Inform *gmsg;
BoxCornerDomain::BoxCornerDomain(double A, double B, double C, double length,
double L1, double L2, Vector_t nr, Vector_t hr,
std::string interpl)
: IrregularDomain(nr, hr)
: IrregularDomain(nr, hr, interpl)
{
setRangeMin(Vector_t(-A, -B, L1));
setRangeMax(Vector_t( A, B, L1 + L2));
C_m = C;
length_m = length;
if(interpl == "CONSTANT")
interpolationMethod = CONSTANT;
else if(interpl == "LINEAR")
interpolationMethod = LINEAR;
else if(interpl == "QUADRATIC")
interpolationMethod = QUADRATIC;
if(Ippl::getNodes() == 1) {
*gmsg << " Write BoxCorner data to file boxcorner.dat" << endl;
std::string file("boxcorner.dat");
......@@ -115,7 +108,7 @@ void BoxCornerDomain::compute(Vector_t hr, NDIndex<3> /*localId*/){
//XXX: calculate intersection on the fly
/*
switch(interpolationMethod) {
switch(interpolationMethod_m) {
case CONSTANT:
break;
......@@ -149,7 +142,7 @@ void BoxCornerDomain::compute(Vector_t hr, NDIndex<3> /*localId*/){
void BoxCornerDomain::getBoundaryStencil(int x, int y, int z, StencilValue_t& value, double &scaleFactor) {
// determine which interpolation method we use for points near the boundary
switch(interpolationMethod) {
switch(interpolationMethod_m) {
case CONSTANT:
constantInterpolation(x, y, z, value, scaleFactor);
break;
......
......@@ -147,9 +147,6 @@ private:
/// length of the structure
double length_m;
/// interpolation type
int interpolationMethod;
/// for debug reasons
std::ofstream os_m;
......
......@@ -37,20 +37,13 @@
EllipticDomain::EllipticDomain(BoundaryGeometry *bgeom, Vector_t nr, Vector_t hr,
std::string interpl)
: IrregularDomain(nr, hr)
: IrregularDomain(nr, hr, interpl)
{
Vector_t min(-bgeom->getA(), -bgeom->getB(), bgeom->getS());
Vector_t max( bgeom->getA(), bgeom->getB(), bgeom->getS() + bgeom->getLength());
setRangeMin(min);
setRangeMax(max);
setMinMaxZ(min[2], max[2]);
if (interpl == "CONSTANT")
interpolationMethod_m = CONSTANT;
else if (interpl == "LINEAR")
interpolationMethod_m = LINEAR;
else if (interpl == "QUADRATIC")
interpolationMethod_m = QUADRATIC;
}
EllipticDomain::~EllipticDomain() {
......
......@@ -92,9 +92,6 @@ private:
/// number of nodes in the xy plane (for this case: independent of the z coordinate)
int nxy_m;
/// interpolation type
int interpolationMethod_m;
/// conversion from (x,y) to index in xy plane
inline int toCoordIdx(int x, int y) { return y * nr_m[0] + x; }
......
......@@ -25,11 +25,23 @@
//
#include "Solvers/IrregularDomain.h"
#include "Utilities/OpalException.h"
IrregularDomain::IrregularDomain(const Vector_t& nr, const Vector_t& hr)
IrregularDomain::IrregularDomain(const Vector_t& nr, const Vector_t& hr,
const std::string& interpl)
: nr_m(nr)
, hr_m(hr)
{ }
{
if (interpl == "CONSTANT")
interpolationMethod_m = CONSTANT;
else if (interpl == "LINEAR")
interpolationMethod_m = LINEAR;
else if (interpl == "QUADRATIC")
interpolationMethod_m = QUADRATIC;
else
throw OpalException("IrregularDomain::IrregularDomain",
"No interpolation method '" + interpl + "' available.");
}
void IrregularDomain::getNeighbours(int x, int y, int z, StencilIndex_t& index)
......
......@@ -58,7 +58,8 @@ public:
typedef Stencil<double> StencilValue_t;
IrregularDomain(const Vector_t& nr,
const Vector_t& hr);
const Vector_t& hr,
const std::string& interpl);
/** method to compute the intersection points with the boundary geometry
......@@ -167,6 +168,9 @@ protected:
/// flag indicating if geometry has changed for the current time-step
bool hasGeometryChanged_m;
/// interpolation type
int interpolationMethod_m;
};
......
......@@ -29,7 +29,7 @@
#include "Utilities/OpalException.h"
RectangularDomain::RectangularDomain(double a, double b, Vector_t nr, Vector_t hr)
: IrregularDomain(nr, hr)
: IrregularDomain(nr, hr, "CONSTANT")
{
setRangeMin(Vector_t(-a, -b, getMinZ()));
setRangeMax(Vector_t( a, b, getMaxZ()));
......
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