Commit a530b34f authored by Praetorius, Simon's avatar Praetorius, Simon

AMDiS now compiles with -pedantic

parent 2a1849f9
......@@ -27,8 +27,6 @@ namespace AMDiS {
void init(int argc, char **argv, std::string initFileName)
{
FUNCNAME("AMDiS::init()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_MTL4
mtl_environment = new mtl::par::environment(argc, argv);
......@@ -113,9 +111,8 @@ namespace AMDiS {
void init(std::string initFileName)
{
FUNCNAME("AMDiS::init()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
FUNCNAME("AMDiS::init()");
ERROR_EXIT("Does not work in parallel!\n");
#endif
......@@ -125,8 +122,6 @@ namespace AMDiS {
void finalize()
{
FUNCNAME("AMDiS::finalize()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor::globalMeshDistributor->exitParallelization();
delete MeshDistributor::globalMeshDistributor;
......
......@@ -413,7 +413,7 @@ namespace AMDiS {
/// Returns \ref est_sum.
inline double getEstSum(int index)
{
FUNCNAME("AdaptInfo::getEstSum()");
FUNCNAME_DBG("AdaptInfo::getEstSum()");
TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size())
("Wrong index for adaptInfo!\n");
......@@ -430,7 +430,7 @@ namespace AMDiS {
/// Returns \ref est_max.
inline double getEstMax(int index)
{
FUNCNAME("AdaptInfo::getEstSum()");
FUNCNAME_DBG("AdaptInfo::getEstSum()");
TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size())
("Wrong index for adaptInfo!\n");
......
......@@ -55,7 +55,6 @@ namespace AMDiS {
breakWhenStable(0),
dbgMode(false)
{
FUNCNAME("AdaptInstationary::AdaptInstationary()");
initConstructor(&problemStat, &info, &initialInfo, initialTimestampSet);
}
......@@ -66,6 +65,7 @@ namespace AMDiS {
AdaptInfo *initialInfo,
time_t initialTimestampSet)
{
FUNCNAME("AdaptInstationary::initConstructor()");
initialize(name);
fixedTimestep = (info->getMinTimestep() == info->getMaxTimestep());
......@@ -360,8 +360,6 @@ namespace AMDiS {
void AdaptInstationary::initialize(std::string aName)
{
FUNCNAME("AdaptInstationary::initialize()");
strategy = 0;
timeDelta1 = 0.7071;
timeDelta2 = 1.4142;
......@@ -382,8 +380,6 @@ namespace AMDiS {
void AdaptInstationary::serialize(std::ostream &out)
{
FUNCNAME("AdaptInstationary::serialize()");
problemIteration->serialize(out);
adaptInfo->serialize(out);
if (problemTime)
......
......@@ -50,8 +50,6 @@ namespace AMDiS {
int AdaptStationary::adapt()
{
FUNCNAME("AdaptStationary::adapt()");
#if HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor::globalMeshDistributor->initParallelization();
#endif
......@@ -92,9 +90,7 @@ namespace AMDiS {
void AdaptStationary::initialize()
{
FUNCNAME("AdaptStationary::initialize()");
{
Parameters::get(name + "->info", info);
}
......
......@@ -49,8 +49,6 @@ namespace AMDiS {
ElementMatrix& userMat,
double factor)
{
FUNCNAME("Assembler::calculateElementMatrix()");
if (remember && (factor != 1.0 || operat->uhOld))
rememberElMat = true;
......@@ -94,8 +92,6 @@ namespace AMDiS {
ElementMatrix& userMat,
double factor)
{
FUNCNAME("Assembler::calculateElementMatrix()");
if (remember && (factor != 1.0 || operat->uhOld))
rememberElMat = true;
......@@ -200,8 +196,6 @@ namespace AMDiS {
ElementVector& userVec,
double factor)
{
FUNCNAME("Assembler::calculateElementVector()");
if (remember && factor != 1.0)
rememberElVec = true;
......@@ -308,8 +302,6 @@ namespace AMDiS {
void Assembler::matVecAssemble(const ElInfo *elInfo, ElementVector& vec)
{
FUNCNAME("Assembler::matVecAssemble()");
Element *el = elInfo->getElement();
ElementVector uhOldLoc(operat->uhOld->getFeSpace() == rowFeSpace ?
nRow : nCol);
......
......@@ -31,8 +31,6 @@ namespace AMDiS {
degree(degree_),
dim(dim_)
{
FUNCNAME("BasisFunction::BasisFunction()");
nDOF = new DimVec<int>(dim, DEFAULT_VALUE, -1);
dow = Global::getGeo(WORLD);
}
......
......@@ -61,9 +61,11 @@ namespace AMDiS {
if (obj0.subObj == EDGE) {
int el0_v0 = obj0.el->getVertexOfEdge(obj0.ithObj, 0);
int el0_v1 = obj0.el->getVertexOfEdge(obj0.ithObj, 1);
int el1_v0 = obj0.el->getVertexOfEdge(obj1.ithObj, 0);
#if DEBUG != 0
int el0_v1 = obj0.el->getVertexOfEdge(obj0.ithObj, 1);
int el1_v1 = obj0.el->getVertexOfEdge(obj1.ithObj, 1);
#endif
const BasisFunction *basFcts = feSpace->getBasisFcts();
int nBasFcts = basFcts->getNumber();
......
......@@ -31,7 +31,7 @@ namespace AMDiS {
void CoarseningManager2d::coarsenTriangle(Triangle *el)
{
FUNCNAME("CoarseningManager2d::coarseTriangle()");
FUNCNAME_DBG("CoarseningManager2d::coarseTriangle()");
Triangle *child[2];
child[0] = dynamic_cast<Triangle*>(const_cast<Element*>(el->getChild(0)));
......
......@@ -25,7 +25,9 @@ namespace AMDiS {
void CoarseningManager3d::coarsenFunction(ElInfo *elInfo)
{
FUNCNAME("CoarseningManager3d::coarsenFunction()");
#if HAVE_PARALLEL_DOMAIN_AMDIS
FUNCNAME_DBG("CoarseningManager3d::coarsenFunction()");
#endif
Tetrahedron *el =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getElement()));
......@@ -284,7 +286,7 @@ namespace AMDiS {
RCNeighbourList &coarsenList,
int *n_neigh)
{
FUNCNAME("CoarseningManager3d::getCoarsenPatch()");
FUNCNAME_DBG("CoarseningManager3d::getCoarsenPatch()");
static unsigned char next_el[6][2] = {{3,2},
{1,3},
......@@ -429,7 +431,7 @@ namespace AMDiS {
int n_neigh,
int bound)
{
FUNCNAME("CoarseningManager3d::coarsenPatch()");
FUNCNAME_DBG("CoarseningManager3d::coarsenPatch()");
Tetrahedron *el =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList.getElement(0)));
......
......@@ -63,7 +63,7 @@ namespace AMDiS {
const FiniteElemSpace* ComponentTraverseInfo::getRowFeSpace(int row)
{
FUNCNAME("ComponentTraverseInfo::getRowFeSpace()");
FUNCNAME_DBG("ComponentTraverseInfo::getRowFeSpace()");
TEST_EXIT_DBG(row < nComponents)("No component traverse info for this row!\n");
TEST_EXIT_DBG(matrixComponents[row][row].getRowFeSpace() ==
......@@ -76,7 +76,7 @@ namespace AMDiS {
const FiniteElemSpace* ComponentTraverseInfo::getNonRowFeSpace(int row)
{
FUNCNAME("ComponentTraverseInfo::getNonRowFeSpace()");
FUNCNAME_DBG("ComponentTraverseInfo::getNonRowFeSpace()");
TEST_EXIT_DBG(row < nComponents)("No component traverse info for this row!\n");
......
......@@ -78,7 +78,7 @@ namespace AMDiS {
const FiniteElemSpace *getAuxFeSpace()
{
FUNCNAME("SingleComponentInfo::getAuxFeSpace()");
FUNCNAME_DBG("SingleComponentInfo::getAuxFeSpace()");
TEST_EXIT_DBG(auxFeSpaces.size() <= 1)("More than one aux FE space!\n");
......
......@@ -36,7 +36,7 @@ namespace AMDiS {
problems.insert(pos, probIter);
solveProblem.insert(pos2, true);
};
}
/// Called before each adaption loop iteration.
......@@ -51,7 +51,7 @@ namespace AMDiS {
adaptInfo->getTimestepNumber() + 1,
nTimesteps);
MSG("==================================================\n");
};
}
/** \brief
......@@ -60,7 +60,7 @@ namespace AMDiS {
* e.g. in timestep adaption loops of timestep adaptive strategies.
*/
Flag CouplingIterationInterface::oneIteration(AdaptInfo *adaptInfo, Flag toDo)
{ FUNCNAME("CouplingIterationInterface::oneIteration()");
{
Flag flag = 0;
for (size_t i = 0; i < problems.size(); ++i) {
......@@ -72,7 +72,7 @@ namespace AMDiS {
}
return flag;
};
}
/// Called after each adaption loop iteration.
......@@ -82,7 +82,7 @@ namespace AMDiS {
MSG("end of iteration number: %d\n",
adaptInfo->getTimestepNumber() + 1);
MSG("==================================================\n");
};
}
/// Returns number of managed problems
......@@ -92,7 +92,7 @@ namespace AMDiS {
for (size_t i = 0; i < problems.size(); ++i)
num += problems[i]->getNumProblems();
return num;
};
}
/** \brief
......@@ -116,7 +116,7 @@ namespace AMDiS {
if (probIter == NULL)
throw(std::runtime_error("Problem not found. Should not happen, since number is in range."));
return probIter;
};
}
/// Returns the name of the problem.
......@@ -126,7 +126,7 @@ namespace AMDiS {
throw(std::runtime_error("Problem number out of range."));
return problems[number]->getName();
};
}
void CouplingIterationInterface::setSolveProblem(std::string name, bool flag)
......@@ -137,6 +137,6 @@ namespace AMDiS {
break;
}
}
};
}
} // namespace AMDiS
......@@ -106,7 +106,7 @@ namespace AMDiS {
void DOFAdmin::freeDofIndex(int dof)
{
FUNCNAME("DOFAdmin::freeDofIndex()");
FUNCNAME_DBG("DOFAdmin::freeDofIndex()");
TEST_EXIT_DBG(usedCount > 0)("No DOFs in use!\n");
TEST_EXIT_DBG(dof >= 0 && dof < size)("Invalid DOF index %d!\n", dof);
......@@ -135,7 +135,7 @@ namespace AMDiS {
int DOFAdmin::getDOFIndex()
{
FUNCNAME("DOFAdmin::getDOFIndex()");
FUNCNAME_DBG("DOFAdmin::getDOFIndex()");
int dof = 0;
// if there is a hole
......@@ -174,9 +174,7 @@ namespace AMDiS {
void DOFAdmin::enlargeDofLists(int minsize)
{
FUNCNAME("DOFAdmin::enlargeDofLists()");
{
int old = size;
if (minsize > 0)
if (old > minsize)
......@@ -235,7 +233,7 @@ namespace AMDiS {
void DOFAdmin::addDOFContainer(DOFContainer* cont)
{
FUNCNAME("DOFAdmin::addDOFContainer()");
FUNCNAME_DBG("DOFAdmin::addDOFContainer()");
TEST_EXIT_DBG(cont)("no container\n");
......@@ -262,7 +260,7 @@ namespace AMDiS {
void DOFAdmin::compress(std::vector<DegreeOfFreedom> &newDofIndex)
{
FUNCNAME("DOFAdmin::compress()");
FUNCNAME_DBG("DOFAdmin::compress()");
// nothing to do ?
if (size < 1 || usedCount < 1 || holeCount < 1)
......@@ -321,7 +319,7 @@ namespace AMDiS {
void DOFAdmin::setNumberOfDofs(int i, int v)
{
FUNCNAME("DOFAdmin::setNumberOfDOFs()");
FUNCNAME_DBG("DOFAdmin::setNumberOfDOFs()");
TEST_EXIT_DBG(0 <= i && 4 > i)("Should not happen!\n");
......@@ -331,7 +329,7 @@ namespace AMDiS {
void DOFAdmin::setNumberOfPreDofs(int i, int v)
{
FUNCNAME("DOFAdmin::setNumberOfPreDOFs()");
FUNCNAME_DBG("DOFAdmin::setNumberOfPreDOFs()");
TEST_EXIT_DBG(0 <= i && 4 > i)("Should not happen!\n");
......
......@@ -53,7 +53,7 @@ namespace AMDiS {
*/
virtual void compressDofContainer(int size, std::vector<DegreeOfFreedom> &newDOF)
{
FUNCNAME("DOFContainer::compressDofContainer()");
FUNCNAME_DBG("DOFContainer::compressDofContainer()");
for (int i = 0; i < size; i++) {
int j = newDOF[operator[](i)];
......
......@@ -88,8 +88,6 @@ namespace AMDiS {
DOFMatrix::~DOFMatrix()
{
FUNCNAME("DOFMatrix::~DOFMatrix()");
if (rowFeSpace && rowFeSpace->getAdmin())
(const_cast<DOFAdmin*>(rowFeSpace->getAdmin()))->removeDOFIndexed(this);
if (boundaryManager)
......@@ -101,8 +99,6 @@ namespace AMDiS {
void DOFMatrix::print() const
{
FUNCNAME("DOFMatrix::print()");
if (inserter)
inserter->print();
}
......@@ -110,8 +106,6 @@ namespace AMDiS {
bool DOFMatrix::symmetric()
{
FUNCNAME("DOFMatrix::symmetric()");
double tol = 1e-5;
using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end;
......@@ -177,7 +171,7 @@ namespace AMDiS {
ElInfo* rowElInfo,
ElInfo* colElInfo)
{
FUNCNAME("DOFMatrix::addElementMatrix()");
FUNCNAME_DBG("DOFMatrix::addElementMatrix()");
TEST_EXIT_DBG(inserter)("DOFMatrix is not in insertion mode\n");
TEST_EXIT_DBG(rowFeSpace)("Have now rowFeSpace!\n");
......@@ -298,8 +292,6 @@ namespace AMDiS {
ElInfo *elInfo,
const BoundaryType *bound)
{
FUNCNAME("DOFMatrix::assemble()");
set_to_zero(elementMatrix);
std::vector<Operator*>::iterator it = operators.begin();
......@@ -322,7 +314,7 @@ namespace AMDiS {
const BoundaryType *bound,
Operator *op)
{
FUNCNAME("DOFMatrix::assemble()");
FUNCNAME_DBG("DOFMatrix::assemble()");
TEST_EXIT_DBG(op)("No operator!\n");
......@@ -341,8 +333,6 @@ namespace AMDiS {
ElInfo *smallElInfo, ElInfo *largeElInfo,
const BoundaryType *bound, Operator *op)
{
FUNCNAME("DOFMatrix::assemble()");
if (!op && operators.size() == 0)
return;
......@@ -530,8 +520,6 @@ namespace AMDiS {
void DOFMatrix::clearDirichletRows()
{
FUNCNAME("DOFMatrix::clearDirichletRows()");
// Do the following only in sequential code. In parallel mode, the specific
// solver method must care about dirichlet boundary conditions.
inserter_type &ins = *inserter;
......
......@@ -70,9 +70,7 @@ namespace AMDiS {
template<>
double DOFVector<double>::evalAtPoint(WorldVector<double> &p,
ElInfo *oldElInfo) const
{
FUNCNAME("DOFVector<double>::evalAtCoords()");
{
Mesh *mesh = feSpace->getMesh();
const BasisFunction *basFcts = feSpace->getBasisFcts();
......@@ -120,9 +118,7 @@ namespace AMDiS {
template<>
WorldVector<double> DOFVector<WorldVector<double> >::evalAtPoint(WorldVector<double> &p,
ElInfo *oldElInfo) const
{
FUNCNAME("DOFVector<double>::evalAtCoords()");
{
Mesh *mesh = feSpace->getMesh();
const BasisFunction *basFcts = feSpace->getBasisFcts();
......@@ -384,7 +380,6 @@ namespace AMDiS {
template<>
void DOFVector<double>::interpol(DOFVector<double> *source, double factor)
{
FUNCNAME("DOFVector<double>::interpol()");
const FiniteElemSpace *sourceFeSpace = source->getFeSpace();
const BasisFunction *basisFcts = feSpace->getBasisFcts();
......@@ -468,6 +463,7 @@ namespace AMDiS {
void DOFVector<WorldVector<double> >::interpol(DOFVector<WorldVector<double> > *v,
double factor)
{
FUNCNAME("DOFVector<WorldVector<double> >::interpol()");
WorldVector<double> nul(DEFAULT_VALUE,0.0);
this->set(nul);
......@@ -514,7 +510,7 @@ namespace AMDiS {
template<>
WorldVector<DOFVector<double>*> *DOFVector<double>::getGradient(WorldVector<DOFVector<double>*> *grad) const
{
FUNCNAME("DOFVector<double>::getGradient()");
FUNCNAME_DBG("DOFVector<double>::getGradient()");
Mesh *mesh = feSpace->getMesh();
int dim = mesh->getDim();
......@@ -619,7 +615,7 @@ namespace AMDiS {
WorldVector<DOFVector<double>*> *transform(DOFVector<WorldVector<double> > *vec,
WorldVector<DOFVector<double>*> *res)
{
FUNCNAME("DOFVector<double>::transform()");
FUNCNAME_DBG("DOFVector<double>::transform()");
TEST_EXIT_DBG(vec)("no vector\n");
......@@ -649,8 +645,6 @@ namespace AMDiS {
const BoundaryType *bound,
Operator *op)
{
FUNCNAME("DOFVector::assemble()");
if (!(op || this->operators.size()))
return;
......
......@@ -424,7 +424,7 @@ namespace AMDiS {
/// Resizes \ref vec to n
inline void resize(int n)
{
FUNCNAME("DOFVector<T>::resize()");
FUNCNAME_DBG("DOFVector<T>::resize()");
TEST_EXIT_DBG(n >= 0)("Can't resize DOFVector to negative size\n");
vec.resize(n);
}
......@@ -432,7 +432,7 @@ namespace AMDiS {
/// Resizes \ref vec to n and inits new values with init
inline void resize(int n, T init)
{
FUNCNAME("DOFVector<T>::resize()");
FUNCNAME_DBG("DOFVector<T>::resize()");
TEST_EXIT_DBG(n >= 0)("Can't resize DOFVector to negative size\n");
vec.resize(n, init);
}
......@@ -440,7 +440,7 @@ namespace AMDiS {
/// Returns \ref vec[i]
inline const T& operator[](DegreeOfFreedom i) const
{
FUNCNAME("DOFVector<T>::operator[]");
FUNCNAME_DBG("DOFVector<T>::operator[]");
TEST_EXIT_DBG(i >= 0 && i < static_cast<int>(vec.size()))
("Illegal vector index %d.\n", i);
return vec[i];
......@@ -449,7 +449,7 @@ namespace AMDiS {
/// Returns \ref vec[i]
inline T& operator[](DegreeOfFreedom i)
{
FUNCNAME("DOFVector<T>::operator[]");
FUNCNAME_DBG("DOFVector<T>::operator[]");
TEST_EXIT_DBG(i >= 0 && i < static_cast<int>(vec.size()))
("Illegal vector index %d.\n", i);
......@@ -848,6 +848,7 @@ namespace AMDiS {
template<typename T>
inline void checkFeSpace(const FiniteElemSpace* feSpace, const std::vector<T>& vec)
{
FUNCNAME_DBG("checkFeSpace()");
TEST_EXIT_DBG(feSpace)("feSpace is NULL\n");
TEST_EXIT_DBG(feSpace->getAdmin())("admin is NULL\n");
TEST_EXIT_DBG(static_cast<int>(vec.size()) >= feSpace->getAdmin()->getUsedSize())
......
......@@ -139,8 +139,6 @@ namespace AMDiS {
ElInfo *elInfo,
bool add)
{
FUNCNAME("DOFVector::addElementVector()");
std::vector<DegreeOfFreedom> indices(nBasFcts);
feSpace->getBasisFcts()->getLocalIndices(elInfo->getElement(),
feSpace->getAdmin(),
......@@ -164,8 +162,6 @@ namespace AMDiS {
template<typename T>
double DOFVector<T>::nrm2() const
{
FUNCNAME("DOFVector<T>::nrm2()");
checkFeSpace(this->feSpace, vec);
double nrm = 0.0;
......@@ -186,8 +182,6 @@ namespace AMDiS {
template<typename T>
double DOFVector<T>::squareNrm2() const
{
FUNCNAME("DOFVector<T>::nrm2()");
checkFeSpace(this->feSpace, vec);
double nrm = 0.0;
......@@ -208,8 +202,6 @@ namespace AMDiS {
template<typename T>
T DOFVector<T>::asum() const
{
FUNCNAME("DOFVector<T>::asum()");
checkFeSpace(this->feSpace, vec);
double nrm = 0.0;
......@@ -230,8 +222,6 @@ namespace AMDiS {
template<typename T>
T DOFVector<T>::sum() const
{
FUNCNAME("DOFVector<T>::sum()");
checkFeSpace(this->feSpace, vec);
double nrm = 0.0;
......@@ -252,8 +242,6 @@ namespace AMDiS {
template<typename T>
void DOFVector<T>::set(T alpha)
{
FUNCNAME("DOFVector<T>::set()");
checkFeSpace(this->feSpace, vec);
Iterator vecIterator(dynamic_cast<DOFIndexed<T>*>(this), USED_DOFS);
......@@ -265,7 +253,7 @@ namespace AMDiS {
template<typename T>
void DOFVector<T>::copy(const DOFVector<T>& x)
{
FUNCNAME("DOFVector<T>::copy()");
FUNCNAME_DBG("DOFVector<T>::copy()");
checkFeSpace(this->feSpace, vec);
......@@ -285,9 +273,7 @@ namespace AMDiS {
template<typename T>
T DOFVector<T>::min() const
{
FUNCNAME("DOFVector<T>::min()");
{
checkFeSpace(this->feSpace, vec);
T m;
......@@ -306,9 +292,7 @@ namespace AMDiS {
template<typename T>
T DOFVector<T>::max() const
{
FUNCNAME("DOFVector<T>::max()");
{
checkFeSpace(this->feSpace, vec);
T m;
......@@ -334,9 +318,7 @@ namespace AMDiS {