Commit 99303ce3 authored by Praetorius, Simon's avatar Praetorius, Simon

A lot of changes in the solver interface

parent fc619e37
...@@ -38,7 +38,7 @@ namespace AMDiS { ...@@ -38,7 +38,7 @@ namespace AMDiS {
using namespace std; using namespace std;
#if defined(HAVE_PARALLEL_MTL4) #if defined(HAVE_PARALLEL_MTL4)
mtl::par::environment* mtl_environment = nullptr; mtl::par::environment* mtl_environment = NULL;
#endif #endif
void init(int argc, char **argv, std::string initFileName) void init(int argc, char **argv, std::string initFileName)
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
#include "solver/ITL_Preconditioner.h" #include "solver/ITL_Preconditioner.h"
#include "solver/ITL_Solver.h" #include "solver/ITL_Solver.h"
#include "solver/LinearSolver.h" #include "solver/LinearSolverInterface.h"
#include "time/RosenbrockAdaptInstationary.h" #include "time/RosenbrockAdaptInstationary.h"
#include "time/RosenbrockStationary.h" #include "time/RosenbrockStationary.h"
......
...@@ -66,7 +66,7 @@ namespace AMDiS { ...@@ -66,7 +66,7 @@ namespace AMDiS {
class Marker; class Marker;
class Mesh; class Mesh;
class MeshStructure; class MeshStructure;
class LinearSolver; class LinearSolverInterface;
class Operator; class Operator;
class OperatorTerm; class OperatorTerm;
class Parametric; class Parametric;
...@@ -153,7 +153,7 @@ namespace AMDiS { ...@@ -153,7 +153,7 @@ namespace AMDiS {
template<typename T> class DOFVector; template<typename T> class DOFVector;
template<typename T> class DimVec; template<typename T> class DimVec;
template<typename T> class DimMat; template<typename T> class DimMat;
// template<typename ITLSolver> class ITL_LinearSolver; // template<typename ITLSolver> class ITL_LinearSolverInterface;
template<typename T, typename MatT, typename VecT > class ITL_Preconditioner; template<typename T, typename MatT, typename VecT > class ITL_Preconditioner;
template<typename T> class Matrix; template<typename T> class Matrix;
template<typename T> class MatrixOfFixVecs; template<typename T> class MatrixOfFixVecs;
......
...@@ -39,8 +39,8 @@ namespace AMDiS { ...@@ -39,8 +39,8 @@ namespace AMDiS {
AdaptBase(std::string sname, AdaptBase(std::string sname,
ProblemIterationInterface *problemIteration_, ProblemIterationInterface *problemIteration_,
AdaptInfo *adapt, AdaptInfo *adapt,
ProblemTimeInterface *problemTime_ = nullptr, ProblemTimeInterface *problemTime_ = NULL,
AdaptInfo *initialAdaptInfo_ = nullptr) AdaptInfo *initialAdaptInfo_ = NULL)
: name(sname), : name(sname),
problemIteration(problemIteration_), problemIteration(problemIteration_),
adaptInfo(adapt), adaptInfo(adapt),
......
...@@ -44,8 +44,8 @@ namespace AMDiS { ...@@ -44,8 +44,8 @@ namespace AMDiS {
elementMatrix(nRow, nCol), elementMatrix(nRow, nCol),
elementVector(nRow), elementVector(nRow),
tmpMat(nRow, nCol), tmpMat(nRow, nCol),
lastMatEl(nullptr), lastMatEl(NULL),
lastVecEl(nullptr), lastVecEl(NULL),
lastTraverseId(-1) lastTraverseId(-1)
{} {}
...@@ -105,7 +105,7 @@ namespace AMDiS { ...@@ -105,7 +105,7 @@ namespace AMDiS {
rememberElMat = true; rememberElMat = true;
Element *el = smallElInfo->getElement(); Element *el = smallElInfo->getElement();
lastVecEl = lastMatEl = nullptr; lastVecEl = lastMatEl = NULL;
if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized()) if ((el != lastMatEl && el != lastVecEl) || !operat->isOptimized())
initElement(smallElInfo, largeElInfo); initElement(smallElInfo, largeElInfo);
...@@ -341,7 +341,7 @@ namespace AMDiS { ...@@ -341,7 +341,7 @@ namespace AMDiS {
TEST_EXIT(rowFeSpace->getBasisFcts() == colFeSpace->getBasisFcts()) TEST_EXIT(rowFeSpace->getBasisFcts() == colFeSpace->getBasisFcts())
("Works only for equal basis functions for different components!\n"); ("Works only for equal basis functions for different components!\n");
Element *usedEl = nullptr; Element *usedEl = NULL;
if (operat->uhOld->getFeSpace()->getMesh() == auxElInfo->getMesh()) if (operat->uhOld->getFeSpace()->getMesh() == auxElInfo->getMesh())
usedEl = auxElInfo->getElement(); usedEl = auxElInfo->getElement();
else if (operat->uhOld->getFeSpace()->getMesh() == mainElInfo->getMesh()) else if (operat->uhOld->getFeSpace()->getMesh() == mainElInfo->getMesh())
...@@ -428,8 +428,8 @@ namespace AMDiS { ...@@ -428,8 +428,8 @@ namespace AMDiS {
void Assembler::finishAssembling() void Assembler::finishAssembling()
{ {
lastVecEl = nullptr; lastVecEl = NULL;
lastMatEl = nullptr; lastMatEl = NULL;
} }
......
...@@ -57,7 +57,7 @@ namespace AMDiS { ...@@ -57,7 +57,7 @@ namespace AMDiS {
/// Constructor /// Constructor
Assembler(Operator *op, Assembler(Operator *op,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = nullptr); const FiniteElemSpace *colFeSpace = NULL);
/// Destructor /// Destructor
~Assembler(); ~Assembler();
...@@ -155,8 +155,8 @@ namespace AMDiS { ...@@ -155,8 +155,8 @@ namespace AMDiS {
/// Initialisation for the given ElInfo. The call is deligated to the sub assemblers. /// Initialisation for the given ElInfo. The call is deligated to the sub assemblers.
void initElement(const ElInfo *smallElInfo, void initElement(const ElInfo *smallElInfo,
const ElInfo *largeElInfo = nullptr, const ElInfo *largeElInfo = NULL,
Quadrature *quad = nullptr); Quadrature *quad = NULL);
/// Sets quadratures of all sub assemblers. /// Sets quadratures of all sub assemblers.
void setQuadratures(Quadrature *quad2, void setQuadratures(Quadrature *quad2,
...@@ -287,7 +287,7 @@ namespace AMDiS { ...@@ -287,7 +287,7 @@ namespace AMDiS {
Quadrature *quad1GrdPhi, Quadrature *quad1GrdPhi,
Quadrature *quad0, Quadrature *quad0,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = nullptr); const FiniteElemSpace *colFeSpace = NULL);
}; };
/** /**
...@@ -306,7 +306,7 @@ namespace AMDiS { ...@@ -306,7 +306,7 @@ namespace AMDiS {
Quadrature *quad1GrdPhi, Quadrature *quad1GrdPhi,
Quadrature *quad0, Quadrature *quad0,
const FiniteElemSpace *rowFeSpace, const FiniteElemSpace *rowFeSpace,
const FiniteElemSpace *colFeSpace = nullptr); const FiniteElemSpace *colFeSpace = NULL);
}; };
} }
......
...@@ -44,7 +44,7 @@ namespace AMDiS { ...@@ -44,7 +44,7 @@ namespace AMDiS {
/// Constructor. /// Constructor.
BoundaryCondition(BoundaryType type, BoundaryCondition(BoundaryType type,
const FiniteElemSpace *rowFeSpace_, const FiniteElemSpace *rowFeSpace_,
const FiniteElemSpace *colFeSpace_ = nullptr) const FiniteElemSpace *colFeSpace_ = NULL)
: boundaryType(type), : boundaryType(type),
rowFeSpace(rowFeSpace_), rowFeSpace(rowFeSpace_),
colFeSpace(colFeSpace_) colFeSpace(colFeSpace_)
......
...@@ -59,7 +59,7 @@ namespace AMDiS { ...@@ -59,7 +59,7 @@ namespace AMDiS {
FUNCNAME("BoundaryManager::addBoundaryCondition()"); FUNCNAME("BoundaryManager::addBoundaryCondition()");
BoundaryType type = localBC->getBoundaryType(); BoundaryType type = localBC->getBoundaryType();
TEST_EXIT(localBCs[type] == nullptr) TEST_EXIT(localBCs[type] == NULL)
("There is already a condition for this type %d.\n",type); ("There is already a condition for this type %d.\n",type);
localBCs[type] = localBC; localBCs[type] = localBC;
......
...@@ -48,7 +48,7 @@ namespace AMDiS { ...@@ -48,7 +48,7 @@ namespace AMDiS {
std::vector<GrdBasFctType*> Bubble::grdPhifunc; // first derivatives std::vector<GrdBasFctType*> Bubble::grdPhifunc; // first derivatives
std::vector<D2BasFctType*> Bubble::D2Phifunc; // second derivatives std::vector<D2BasFctType*> Bubble::D2Phifunc; // second derivatives
Bubble* Bubble::Singleton = nullptr; Bubble* Bubble::Singleton = NULL;
Bubble::Bubble(int dim, int degree) Bubble::Bubble(int dim, int degree)
: BasisFunction(std::string("Bubble"), dim, degree) : BasisFunction(std::string("Bubble"), dim, degree)
...@@ -72,7 +72,7 @@ namespace AMDiS { ...@@ -72,7 +72,7 @@ namespace AMDiS {
for (int i = 0; i < static_cast<int>(bary->size()); i++) for (int i = 0; i < static_cast<int>(bary->size()); i++)
if ((*bary)[i]) { if ((*bary)[i]) {
delete (*bary)[i]; delete (*bary)[i];
(*bary)[i] = nullptr; (*bary)[i] = NULL;
} }
} }
...@@ -80,7 +80,7 @@ namespace AMDiS { ...@@ -80,7 +80,7 @@ namespace AMDiS {
// creates a new FE-Space of this instance // creates a new FE-Space of this instance
Bubble* Bubble::getBubble(int dim, int degree) Bubble* Bubble::getBubble(int dim, int degree)
{ {
if (Singleton == nullptr) //if their is no instance if (Singleton == NULL) //if their is no instance
{ {
Singleton = new Bubble(dim, degree); Singleton = new Bubble(dim, degree);
} }
...@@ -92,7 +92,7 @@ namespace AMDiS { ...@@ -92,7 +92,7 @@ namespace AMDiS {
{ {
if (Singleton) { if (Singleton) {
delete (Singleton); delete (Singleton);
Singleton = nullptr; Singleton = NULL;
} }
} }
...@@ -163,7 +163,7 @@ namespace AMDiS { ...@@ -163,7 +163,7 @@ namespace AMDiS {
{ {
FUNCNAME_DBG("Bubble::setVertices()"); FUNCNAME_DBG("Bubble::setVertices()");
TEST_EXIT_DBG(*vertices == nullptr)("vertices != nullptr\n"); TEST_EXIT_DBG(*vertices == NULL)("vertices != NULL\n");
int dimOfPosition = DIM_OF_INDEX(position, dim); int dimOfPosition = DIM_OF_INDEX(position, dim);
...@@ -186,7 +186,7 @@ namespace AMDiS { ...@@ -186,7 +186,7 @@ namespace AMDiS {
GeoIndex position, GeoIndex position,
int positionIndex, int positionIndex,
int nodeIndex) int nodeIndex)
: vertices(nullptr) : vertices(NULL)
{ {
FUNCNAME("Bubble::Phi::Phi()"); FUNCNAME("Bubble::Phi::Phi()");
...@@ -235,7 +235,7 @@ namespace AMDiS { ...@@ -235,7 +235,7 @@ namespace AMDiS {
GeoIndex position, GeoIndex position,
int positionIndex, int positionIndex,
int nodeIndex) int nodeIndex)
: vertices(nullptr) : vertices(NULL)
{ {
// get relevant vertices // get relevant vertices
Bubble::setVertices(owner->getDim(), Bubble::setVertices(owner->getDim(),
...@@ -280,7 +280,7 @@ namespace AMDiS { ...@@ -280,7 +280,7 @@ namespace AMDiS {
GeoIndex position, GeoIndex position,
int positionIndex, int positionIndex,
int nodeIndex) int nodeIndex)
: vertices(nullptr) : vertices(NULL)
{ {
// get relevant vertices // get relevant vertices
Bubble::setVertices(owner->getDim(), Bubble::setVertices(owner->getDim(),
...@@ -354,7 +354,7 @@ namespace AMDiS { ...@@ -354,7 +354,7 @@ namespace AMDiS {
return &sortedCenter; return &sortedCenter;
ERROR_EXIT("should not be reached\n"); ERROR_EXIT("should not be reached\n");
return nullptr; return NULL;
} }
......
...@@ -33,7 +33,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p) ...@@ -33,7 +33,7 @@ bool Cholesky::factorization(Matrix<double> *A, Vector<double> *p)
int n = A->getNumRows(); int n = A->getNumRows();
// Checking memory for vector P of diagonal elements of factorization. // Checking memory for vector P of diagonal elements of factorization.
static Vector<double> *pT = nullptr; static Vector<double> *pT = NULL;
if (p) if (p)
{ {
...@@ -104,7 +104,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, ...@@ -104,7 +104,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
x = new Vector<double>(n); x = new Vector<double>(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = nullptr; static Vector<double> *pT = NULL;
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
...@@ -158,7 +158,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b, ...@@ -158,7 +158,7 @@ bool Cholesky::solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
x = new Vector<WorldVector<double> >(n); x = new Vector<WorldVector<double> >(n);
// Checking vector P. // Checking vector P.
static Vector<double> *pT = nullptr; static Vector<double> *pT = NULL;
if (!p || (p->getSize() != n)) if (!p || (p->getSize() != n))
{ {
......
...@@ -53,16 +53,16 @@ class Cholesky ...@@ -53,16 +53,16 @@ class Cholesky
/** \brief /** \brief
* Solves system A*X=B, where A is a positive definite matrix. * Solves system A*X=B, where A is a positive definite matrix.
* If P=nullptr; A is assumed to be positive definite, and a Cholesky * If P=NULL; A is assumed to be positive definite, and a Cholesky
* decomposition is computed using the previous routine. * decomposition is computed using the previous routine.
* If P is given, A and P are assumed to be already given as the output of * If P is given, A and P are assumed to be already given as the output of
* the previous routine. * the previous routine.
*/ */
static bool solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x, static bool solve(Matrix<double> *A, Vector<double> *b, Vector<double> *x,
Vector<double> *p = nullptr); Vector<double> *p = NULL);
static bool solve(Matrix<double> *A, Vector<WorldVector<double> > *b, static bool solve(Matrix<double> *A, Vector<WorldVector<double> > *b,
Vector<WorldVector<double> > *x, Vector<WorldVector<double> > *x,
Vector<double> *p = nullptr); Vector<double> *p = NULL);
}; };
} }
......
...@@ -43,8 +43,8 @@ namespace AMDiS { ...@@ -43,8 +43,8 @@ namespace AMDiS {
public: public:
/// Constructs a CoarseningManager which belongs to aMesh /// Constructs a CoarseningManager which belongs to aMesh
CoarseningManager() CoarseningManager()
: mesh(nullptr), : mesh(NULL),
stack(nullptr), stack(NULL),
doMore(0) doMore(0)
{} {}
......
...@@ -134,8 +134,8 @@ namespace AMDiS { ...@@ -134,8 +134,8 @@ namespace AMDiS {
parent->coarsenElementData(child[0], child[1]); parent->coarsenElementData(child[0], child[1]);
parent->setFirstChild(nullptr); parent->setFirstChild(NULL);
parent->setSecondChild(nullptr); parent->setSecondChild(NULL);
mesh->freeElement(child[0]); mesh->freeElement(child[0]);
mesh->freeElement(child[1]); mesh->freeElement(child[1]);
......
...@@ -64,8 +64,8 @@ namespace AMDiS { ...@@ -64,8 +64,8 @@ namespace AMDiS {
el->coarsenElementData(child[0], child[1]); el->coarsenElementData(child[0], child[1]);
el->setFirstChild(nullptr); el->setFirstChild(NULL);
el->setSecondChild(nullptr); el->setSecondChild(NULL);
mesh->freeElement(child[0]); mesh->freeElement(child[0]);
mesh->freeElement(child[1]); mesh->freeElement(child[1]);
...@@ -197,7 +197,7 @@ namespace AMDiS { ...@@ -197,7 +197,7 @@ namespace AMDiS {
DegreeOfFreedom *next_edge[2]; DegreeOfFreedom *next_edge[2];
RCNeighbourList periodicList; RCNeighbourList periodicList;
while (edge[0] != nullptr) { while (edge[0] != NULL) {
coarse_list.periodicSplit(edge, next_edge, coarse_list.periodicSplit(edge, next_edge,
&n_neigh, &n_neigh_periodic, &n_neigh, &n_neigh_periodic,
periodicList); periodicList);
......
...@@ -181,7 +181,7 @@ namespace AMDiS { ...@@ -181,7 +181,7 @@ namespace AMDiS {
DegreeOfFreedom *next_edge[2]; DegreeOfFreedom *next_edge[2];
RCNeighbourList periodicList; RCNeighbourList periodicList;
while (edge[0] != nullptr) { while (edge[0] != NULL) {
coarsenList.periodicSplit(edge, next_edge, coarsenList.periodicSplit(edge, next_edge,
&n_neigh, &n_neigh_periodic, &n_neigh, &n_neigh_periodic,
periodicList); periodicList);
...@@ -262,8 +262,8 @@ namespace AMDiS { ...@@ -262,8 +262,8 @@ namespace AMDiS {
el->coarsenElementData(child[0], child[1], el_type); el->coarsenElementData(child[0], child[1], el_type);
el->setFirstChild(nullptr); el->setFirstChild(NULL);
el->setSecondChild(nullptr); el->setSecondChild(NULL);
mesh->freeElement(child[0]); mesh->freeElement(child[0]);
mesh->freeElement(child[1]); mesh->freeElement(child[1]);
...@@ -309,7 +309,7 @@ namespace AMDiS { ...@@ -309,7 +309,7 @@ namespace AMDiS {
dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getElement())); dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getElement()));
Tetrahedron *neigh = Tetrahedron *neigh =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getNeighbour(3 - dir))); dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getNeighbour(3 - dir)));
if (neigh == nullptr) if (neigh == NULL)
return true; return true;
int opp_v = elInfo->getOppVertex(3 - dir); int opp_v = elInfo->getOppVertex(3 - dir);
...@@ -445,7 +445,7 @@ namespace AMDiS { ...@@ -445,7 +445,7 @@ namespace AMDiS {
Tetrahedron *el = Tetrahedron *el =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList.getElement(0))); dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList.getElement(0)));
DegreeOfFreedom *dof = nullptr; DegreeOfFreedom *dof = NULL;
TEST_EXIT_DBG(el)("No element!\n"); TEST_EXIT_DBG(el)("No element!\n");
TEST_EXIT_DBG(el->getChild(0))("No child in element!\n"); TEST_EXIT_DBG(el->getChild(0))("No child in element!\n");
...@@ -492,7 +492,7 @@ namespace AMDiS { ...@@ -492,7 +492,7 @@ namespace AMDiS {
coarsenList.getElement(0)->eraseNewCoord(); coarsenList.getElement(0)->eraseNewCoord();
for (int i = 0; i < n_neigh; i++) { for (int i = 0; i < n_neigh; i++) {
coarsenList.getElement(i)->setNewCoord(nullptr); coarsenList.getElement(i)->setNewCoord(NULL);
coarsenTetrahedron(coarsenList, i); coarsenTetrahedron(coarsenList, i);
} }
......