Commit c2fdcdc0 authored by frey_m's avatar frey_m
Browse files

SAAMG: remove duplicated getNeighbours function

parent 3e4d8c47
...@@ -535,15 +535,6 @@ void ArbitraryDomain::linearInterpolation(int idx, int idy, int idz, double& W, ...@@ -535,15 +535,6 @@ void ArbitraryDomain::linearInterpolation(int idx, int idy, int idz, double& W,
C += (dz_f + dz_b) * (dx_w + dx_e) * (dy_n + dy_s) / m2; C += (dz_f + dz_b) * (dx_w + dx_e) * (dy_n + dy_s) / m2;
} }
void ArbitraryDomain::getNeighbours(int id, int &W, int &E, int &S,
int &N, int &F, int &B)
{
int idx = 0, idy = 0, idz = 0;
getCoord(id, idx, idy, idz);
getNeighbours(idx, idy, idz, W, E, S, N, F, B);
}
void ArbitraryDomain::getNeighbours(int idx, int idy, int idz, int &W, void ArbitraryDomain::getNeighbours(int idx, int idy, int idz, int &W,
int &E, int &S, int &N, int &F, int &B) int &E, int &S, int &N, int &F, int &B)
{ {
......
...@@ -66,10 +66,6 @@ public: ...@@ -66,10 +66,6 @@ public:
void getNeighbours(int idx, int idy, int idz, int &W, void getNeighbours(int idx, int idy, int idz, int &W,
int &E, int &S, int &N, int &F, int &B); int &E, int &S, int &N, int &F, int &B);
/// returns index of neighbours at 3D index
void getNeighbours(int idxyz, int &W, int &E,
int &S, int &N, int &F, int &B);
/// returns type of boundary condition /// returns type of boundary condition
std::string getType() {return "Geometric";} std::string getType() {return "Geometric";}
/// queries if a given (x,y,z) coordinate lies inside the domain /// queries if a given (x,y,z) coordinate lies inside the domain
......
...@@ -183,14 +183,6 @@ void BoxCornerDomain::getBoundaryStencil(int idx, double &W, double &E, double & ...@@ -183,14 +183,6 @@ void BoxCornerDomain::getBoundaryStencil(int idx, double &W, double &E, double &
} }
void BoxCornerDomain::getNeighbours(int idx, int &W, int &E, int &S, int &N, int &F, int &B) {
int x = 0, y = 0, z = 0;
getCoord(idx, x, y, z);
getNeighbours(x, y, z, W, E, S, N, F, B);
}
void BoxCornerDomain::getNeighbours(int x, int y, int z, int &W, int &E, int &S, int &N, int &F, int &B) { void BoxCornerDomain::getNeighbours(int x, int y, int z, int &W, int &E, int &S, int &N, int &F, int &B) {
if(x > 0) if(x > 0)
......
...@@ -86,9 +86,6 @@ public: ...@@ -86,9 +86,6 @@ public:
/// returns index of neighbours at (x,y,z) /// returns index of neighbours at (x,y,z)
void getNeighbours(int x, int y, int z, int &W, int &E, int &S, int &N, int &F, int &B); void getNeighbours(int x, int y, int z, int &W, int &E, int &S, int &N, int &F, int &B);
/// returns index of neighbours at 3D index
void getNeighbours(int idx, int &W, int &E, int &S, int &N, int &F, int &B);
/// returns type of boundary condition /// returns type of boundary condition
std::string getType() {return "BoxCorner";} std::string getType() {return "BoxCorner";}
......
...@@ -7,7 +7,6 @@ set (_SRCS ...@@ -7,7 +7,6 @@ set (_SRCS
set (HDRS set (HDRS
FFTBoxPoissonSolver.h FFTBoxPoissonSolver.h
FFTPoissonSolver.h FFTPoissonSolver.h
IrregularDomain.h
P3MPoissonSolver.h P3MPoissonSolver.h
PoissonSolver.h PoissonSolver.h
) )
...@@ -17,6 +16,7 @@ if (ENABLE_SAAMG_SOLVER) ...@@ -17,6 +16,7 @@ if (ENABLE_SAAMG_SOLVER)
ArbitraryDomain.cpp ArbitraryDomain.cpp
BoxCornerDomain.cpp BoxCornerDomain.cpp
EllipticDomain.cpp EllipticDomain.cpp
IrregularDomain.cpp
MGPoissonSolver.cpp MGPoissonSolver.cpp
RectangularDomain.cpp RectangularDomain.cpp
) )
...@@ -25,6 +25,7 @@ if (ENABLE_SAAMG_SOLVER) ...@@ -25,6 +25,7 @@ if (ENABLE_SAAMG_SOLVER)
ArbitraryDomain.h ArbitraryDomain.h
BoxCornerDomain.h BoxCornerDomain.h
EllipticDomain.h EllipticDomain.h
IrregularDomain.h
MGPoissonSolver.h MGPoissonSolver.h
RectangularDomain.h RectangularDomain.h
) )
......
...@@ -213,14 +213,6 @@ void EllipticDomain::getBoundaryStencil(int idx, double &W, double &E, ...@@ -213,14 +213,6 @@ void EllipticDomain::getBoundaryStencil(int idx, double &W, double &E,
} }
void EllipticDomain::getNeighbours(int idx, int &W, int &E, int &S, int &N, int &F, int &B) {
int x = 0, y = 0, z = 0;
getCoord(idx, x, y, z);
getNeighbours(x, y, z, W, E, S, N, F, B);
}
void EllipticDomain::getNeighbours(int x, int y, int z, int &W, int &E, void EllipticDomain::getNeighbours(int x, int y, int z, int &W, int &E,
int &S, int &N, int &F, int &B) int &S, int &N, int &F, int &B)
{ {
......
...@@ -67,9 +67,6 @@ public: ...@@ -67,9 +67,6 @@ public:
void getNeighbours(int x, int y, int z, int &W, int &E, void getNeighbours(int x, int y, int z, int &W, int &E,
int &S, int &N, int &F, int &B); int &S, int &N, int &F, int &B);
/// returns index of neighbours at 3D index
void getNeighbours(int idx, int &W, int &E, int &S, int &N, int &F, int &B);
/// returns type of boundary condition /// returns type of boundary condition
std::string getType() {return "Elliptic";} std::string getType() {return "Elliptic";}
......
//
// Class IrregularDomain
// Defines a common abstract interface for different types of boundaries.
//
// Copyright (c) 2008, Yves Ineichen, ETH Zürich,
// 2013 - 2015, Tülin Kaman, Paul Scherrer Institut, Villigen PSI, Switzerland
// 2017 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// Implemented as part of the master thesis
// "A Parallel Multigrid Solver for Beam Dynamics"
// and the paper
// "A fast parallel Poisson solver on irregular domains applied to beam dynamics simulations"
// (https://doi.org/10.1016/j.jcp.2010.02.022)
//
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
#include "Solvers/IrregularDomain.h"
void IrregularDomain::getNeighbours(int id, int &W, int &E, int &S,
int &N, int &F, int &B)
{
int x = 0, y = 0, z = 0;
getCoord(id, x, y, z);
getNeighbours(x, y, z, W, E, S, N, F, B);
}
\ No newline at end of file
...@@ -96,8 +96,11 @@ public: ...@@ -96,8 +96,11 @@ public:
virtual void getNeighbours(int x, int y, int z, int &W, int &E, int &S, virtual void getNeighbours(int x, int y, int z, int &W, int &E, int &S,
int &N, int &F, int &B) = 0; int &N, int &F, int &B) = 0;
virtual void getNeighbours(int idx, int &W, int &E, int &S, int &N, void getNeighbours(int idx, int &W, int &E, int &S, int &N,
int &F, int &B) = 0; int &F, int &B);
virtual void getCoord(int idx, int &x, int &y, int &z) = 0;
/// method that identifies a specialized boundary geometry /// method that identifies a specialized boundary geometry
/// \return std::string containing a description of the boundary geometry used /// \return std::string containing a description of the boundary geometry used
......
...@@ -141,15 +141,6 @@ void RectangularDomain::getBoundaryStencil(int idx, double &W, double &E, double ...@@ -141,15 +141,6 @@ void RectangularDomain::getBoundaryStencil(int idx, double &W, double &E, double
} }
void RectangularDomain::getNeighbours(int idx, double &W, double &E, double &S, double &N, double &F, double &B) {
int x = 0, y = 0, z = 0;
getCoord(idx, x, y, z);
getNeighbours(x, y, z, W, E, S, N, F, B);
}
void RectangularDomain::getNeighbours(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B) { void RectangularDomain::getNeighbours(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B) {
if(x > 0) if(x > 0)
......
...@@ -51,8 +51,6 @@ public: ...@@ -51,8 +51,6 @@ public:
/// returns index of neighbours at (x,y,z) /// returns index of neighbours at (x,y,z)
using IrregularDomain::getNeighbours; using IrregularDomain::getNeighbours;
void getNeighbours(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B); void getNeighbours(int x, int y, int z, double &W, double &E, double &S, double &N, double &F, double &B);
/// returns index of neighbours at 3D index
void getNeighbours(int idx, double &W, double &E, double &S, double &N, double &F, double &B);
/// returns type of boundary condition /// returns type of boundary condition
std::string getType() {return "Rectangular";} std::string getType() {return "Rectangular";}
/// queries if a given (x,y,z) coordinate lies inside the domain /// queries if a given (x,y,z) coordinate lies inside the domain
......
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