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

AMDiS now compiles with -pedantic

parent 2a1849f9
...@@ -27,8 +27,6 @@ namespace AMDiS { ...@@ -27,8 +27,6 @@ namespace AMDiS {
void init(int argc, char **argv, std::string initFileName) void init(int argc, char **argv, std::string initFileName)
{ {
FUNCNAME("AMDiS::init()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_MTL4 #ifdef HAVE_PARALLEL_MTL4
mtl_environment = new mtl::par::environment(argc, argv); mtl_environment = new mtl::par::environment(argc, argv);
...@@ -113,9 +111,8 @@ namespace AMDiS { ...@@ -113,9 +111,8 @@ namespace AMDiS {
void init(std::string initFileName) void init(std::string initFileName)
{ {
FUNCNAME("AMDiS::init()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
FUNCNAME("AMDiS::init()");
ERROR_EXIT("Does not work in parallel!\n"); ERROR_EXIT("Does not work in parallel!\n");
#endif #endif
...@@ -125,8 +122,6 @@ namespace AMDiS { ...@@ -125,8 +122,6 @@ namespace AMDiS {
void finalize() void finalize()
{ {
FUNCNAME("AMDiS::finalize()");
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor::globalMeshDistributor->exitParallelization(); MeshDistributor::globalMeshDistributor->exitParallelization();
delete MeshDistributor::globalMeshDistributor; delete MeshDistributor::globalMeshDistributor;
......
...@@ -413,7 +413,7 @@ namespace AMDiS { ...@@ -413,7 +413,7 @@ namespace AMDiS {
/// Returns \ref est_sum. /// Returns \ref est_sum.
inline double getEstSum(int index) inline double getEstSum(int index)
{ {
FUNCNAME("AdaptInfo::getEstSum()"); FUNCNAME_DBG("AdaptInfo::getEstSum()");
TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size()) TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size())
("Wrong index for adaptInfo!\n"); ("Wrong index for adaptInfo!\n");
...@@ -430,7 +430,7 @@ namespace AMDiS { ...@@ -430,7 +430,7 @@ namespace AMDiS {
/// Returns \ref est_max. /// Returns \ref est_max.
inline double getEstMax(int index) inline double getEstMax(int index)
{ {
FUNCNAME("AdaptInfo::getEstSum()"); FUNCNAME_DBG("AdaptInfo::getEstSum()");
TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size()) TEST_EXIT_DBG(static_cast<unsigned int>(index) < scalContents.size())
("Wrong index for adaptInfo!\n"); ("Wrong index for adaptInfo!\n");
......
...@@ -55,7 +55,6 @@ namespace AMDiS { ...@@ -55,7 +55,6 @@ namespace AMDiS {
breakWhenStable(0), breakWhenStable(0),
dbgMode(false) dbgMode(false)
{ {
FUNCNAME("AdaptInstationary::AdaptInstationary()");
initConstructor(&problemStat, &info, &initialInfo, initialTimestampSet); initConstructor(&problemStat, &info, &initialInfo, initialTimestampSet);
} }
...@@ -66,6 +65,7 @@ namespace AMDiS { ...@@ -66,6 +65,7 @@ namespace AMDiS {
AdaptInfo *initialInfo, AdaptInfo *initialInfo,
time_t initialTimestampSet) time_t initialTimestampSet)
{ {
FUNCNAME("AdaptInstationary::initConstructor()");
initialize(name); initialize(name);
fixedTimestep = (info->getMinTimestep() == info->getMaxTimestep()); fixedTimestep = (info->getMinTimestep() == info->getMaxTimestep());
...@@ -360,8 +360,6 @@ namespace AMDiS { ...@@ -360,8 +360,6 @@ namespace AMDiS {
void AdaptInstationary::initialize(std::string aName) void AdaptInstationary::initialize(std::string aName)
{ {
FUNCNAME("AdaptInstationary::initialize()");
strategy = 0; strategy = 0;
timeDelta1 = 0.7071; timeDelta1 = 0.7071;
timeDelta2 = 1.4142; timeDelta2 = 1.4142;
...@@ -382,8 +380,6 @@ namespace AMDiS { ...@@ -382,8 +380,6 @@ namespace AMDiS {
void AdaptInstationary::serialize(std::ostream &out) void AdaptInstationary::serialize(std::ostream &out)
{ {
FUNCNAME("AdaptInstationary::serialize()");
problemIteration->serialize(out); problemIteration->serialize(out);
adaptInfo->serialize(out); adaptInfo->serialize(out);
if (problemTime) if (problemTime)
......
...@@ -50,8 +50,6 @@ namespace AMDiS { ...@@ -50,8 +50,6 @@ namespace AMDiS {
int AdaptStationary::adapt() int AdaptStationary::adapt()
{ {
FUNCNAME("AdaptStationary::adapt()");
#if HAVE_PARALLEL_DOMAIN_AMDIS #if HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor::globalMeshDistributor->initParallelization(); MeshDistributor::globalMeshDistributor->initParallelization();
#endif #endif
...@@ -92,9 +90,7 @@ namespace AMDiS { ...@@ -92,9 +90,7 @@ namespace AMDiS {
void AdaptStationary::initialize() void AdaptStationary::initialize()
{ {
FUNCNAME("AdaptStationary::initialize()");
Parameters::get(name + "->info", info); Parameters::get(name + "->info", info);
} }
......
...@@ -49,8 +49,6 @@ namespace AMDiS { ...@@ -49,8 +49,6 @@ namespace AMDiS {
ElementMatrix& userMat, ElementMatrix& userMat,
double factor) double factor)
{ {
FUNCNAME("Assembler::calculateElementMatrix()");
if (remember && (factor != 1.0 || operat->uhOld)) if (remember && (factor != 1.0 || operat->uhOld))
rememberElMat = true; rememberElMat = true;
...@@ -94,8 +92,6 @@ namespace AMDiS { ...@@ -94,8 +92,6 @@ namespace AMDiS {
ElementMatrix& userMat, ElementMatrix& userMat,
double factor) double factor)
{ {
FUNCNAME("Assembler::calculateElementMatrix()");
if (remember && (factor != 1.0 || operat->uhOld)) if (remember && (factor != 1.0 || operat->uhOld))
rememberElMat = true; rememberElMat = true;
...@@ -200,8 +196,6 @@ namespace AMDiS { ...@@ -200,8 +196,6 @@ namespace AMDiS {
ElementVector& userVec, ElementVector& userVec,
double factor) double factor)
{ {
FUNCNAME("Assembler::calculateElementVector()");
if (remember && factor != 1.0) if (remember && factor != 1.0)
rememberElVec = true; rememberElVec = true;
...@@ -308,8 +302,6 @@ namespace AMDiS { ...@@ -308,8 +302,6 @@ namespace AMDiS {
void Assembler::matVecAssemble(const ElInfo *elInfo, ElementVector& vec) void Assembler::matVecAssemble(const ElInfo *elInfo, ElementVector& vec)
{ {
FUNCNAME("Assembler::matVecAssemble()");
Element *el = elInfo->getElement(); Element *el = elInfo->getElement();
ElementVector uhOldLoc(operat->uhOld->getFeSpace() == rowFeSpace ? ElementVector uhOldLoc(operat->uhOld->getFeSpace() == rowFeSpace ?
nRow : nCol); nRow : nCol);
......
...@@ -31,8 +31,6 @@ namespace AMDiS { ...@@ -31,8 +31,6 @@ namespace AMDiS {
degree(degree_), degree(degree_),
dim(dim_) dim(dim_)
{ {
FUNCNAME("BasisFunction::BasisFunction()");
nDOF = new DimVec<int>(dim, DEFAULT_VALUE, -1); nDOF = new DimVec<int>(dim, DEFAULT_VALUE, -1);
dow = Global::getGeo(WORLD); dow = Global::getGeo(WORLD);
} }
......
...@@ -61,9 +61,11 @@ namespace AMDiS { ...@@ -61,9 +61,11 @@ namespace AMDiS {
if (obj0.subObj == EDGE) { if (obj0.subObj == EDGE) {
int el0_v0 = obj0.el->getVertexOfEdge(obj0.ithObj, 0); 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); 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); int el1_v1 = obj0.el->getVertexOfEdge(obj1.ithObj, 1);
#endif
const BasisFunction *basFcts = feSpace->getBasisFcts(); const BasisFunction *basFcts = feSpace->getBasisFcts();
int nBasFcts = basFcts->getNumber(); int nBasFcts = basFcts->getNumber();
......
...@@ -31,7 +31,7 @@ namespace AMDiS { ...@@ -31,7 +31,7 @@ namespace AMDiS {
void CoarseningManager2d::coarsenTriangle(Triangle *el) void CoarseningManager2d::coarsenTriangle(Triangle *el)
{ {
FUNCNAME("CoarseningManager2d::coarseTriangle()"); FUNCNAME_DBG("CoarseningManager2d::coarseTriangle()");
Triangle *child[2]; Triangle *child[2];
child[0] = dynamic_cast<Triangle*>(const_cast<Element*>(el->getChild(0))); child[0] = dynamic_cast<Triangle*>(const_cast<Element*>(el->getChild(0)));
......
...@@ -25,7 +25,9 @@ namespace AMDiS { ...@@ -25,7 +25,9 @@ namespace AMDiS {
void CoarseningManager3d::coarsenFunction(ElInfo *elInfo) void CoarseningManager3d::coarsenFunction(ElInfo *elInfo)
{ {
FUNCNAME("CoarseningManager3d::coarsenFunction()"); #if HAVE_PARALLEL_DOMAIN_AMDIS
FUNCNAME_DBG("CoarseningManager3d::coarsenFunction()");
#endif
Tetrahedron *el = Tetrahedron *el =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getElement())); dynamic_cast<Tetrahedron*>(const_cast<Element*>(elInfo->getElement()));
...@@ -284,7 +286,7 @@ namespace AMDiS { ...@@ -284,7 +286,7 @@ namespace AMDiS {
RCNeighbourList &coarsenList, RCNeighbourList &coarsenList,
int *n_neigh) int *n_neigh)
{ {
FUNCNAME("CoarseningManager3d::getCoarsenPatch()"); FUNCNAME_DBG("CoarseningManager3d::getCoarsenPatch()");
static unsigned char next_el[6][2] = {{3,2}, static unsigned char next_el[6][2] = {{3,2},
{1,3}, {1,3},
...@@ -429,7 +431,7 @@ namespace AMDiS { ...@@ -429,7 +431,7 @@ namespace AMDiS {
int n_neigh, int n_neigh,
int bound) int bound)
{ {
FUNCNAME("CoarseningManager3d::coarsenPatch()"); FUNCNAME_DBG("CoarseningManager3d::coarsenPatch()");
Tetrahedron *el = Tetrahedron *el =
dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList.getElement(0))); dynamic_cast<Tetrahedron*>(const_cast<Element*>(coarsenList.getElement(0)));
......
...@@ -63,7 +63,7 @@ namespace AMDiS { ...@@ -63,7 +63,7 @@ namespace AMDiS {
const FiniteElemSpace* ComponentTraverseInfo::getRowFeSpace(int row) 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(row < nComponents)("No component traverse info for this row!\n");
TEST_EXIT_DBG(matrixComponents[row][row].getRowFeSpace() == TEST_EXIT_DBG(matrixComponents[row][row].getRowFeSpace() ==
...@@ -76,7 +76,7 @@ namespace AMDiS { ...@@ -76,7 +76,7 @@ namespace AMDiS {
const FiniteElemSpace* ComponentTraverseInfo::getNonRowFeSpace(int row) 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"); TEST_EXIT_DBG(row < nComponents)("No component traverse info for this row!\n");
......
...@@ -78,7 +78,7 @@ namespace AMDiS { ...@@ -78,7 +78,7 @@ namespace AMDiS {
const FiniteElemSpace *getAuxFeSpace() const FiniteElemSpace *getAuxFeSpace()
{ {
FUNCNAME("SingleComponentInfo::getAuxFeSpace()"); FUNCNAME_DBG("SingleComponentInfo::getAuxFeSpace()");
TEST_EXIT_DBG(auxFeSpaces.size() <= 1)("More than one aux FE space!\n"); TEST_EXIT_DBG(auxFeSpaces.size() <= 1)("More than one aux FE space!\n");
......
...@@ -36,7 +36,7 @@ namespace AMDiS { ...@@ -36,7 +36,7 @@ namespace AMDiS {
problems.insert(pos, probIter); problems.insert(pos, probIter);
solveProblem.insert(pos2, true); solveProblem.insert(pos2, true);
}; }
/// Called before each adaption loop iteration. /// Called before each adaption loop iteration.
...@@ -51,7 +51,7 @@ namespace AMDiS { ...@@ -51,7 +51,7 @@ namespace AMDiS {
adaptInfo->getTimestepNumber() + 1, adaptInfo->getTimestepNumber() + 1,
nTimesteps); nTimesteps);
MSG("==================================================\n"); MSG("==================================================\n");
}; }
/** \brief /** \brief
...@@ -60,7 +60,7 @@ namespace AMDiS { ...@@ -60,7 +60,7 @@ namespace AMDiS {
* e.g. in timestep adaption loops of timestep adaptive strategies. * e.g. in timestep adaption loops of timestep adaptive strategies.
*/ */
Flag CouplingIterationInterface::oneIteration(AdaptInfo *adaptInfo, Flag toDo) Flag CouplingIterationInterface::oneIteration(AdaptInfo *adaptInfo, Flag toDo)
{ FUNCNAME("CouplingIterationInterface::oneIteration()"); {
Flag flag = 0; Flag flag = 0;
for (size_t i = 0; i < problems.size(); ++i) { for (size_t i = 0; i < problems.size(); ++i) {
...@@ -72,7 +72,7 @@ namespace AMDiS { ...@@ -72,7 +72,7 @@ namespace AMDiS {
} }
return flag; return flag;
}; }
/// Called after each adaption loop iteration. /// Called after each adaption loop iteration.
...@@ -82,7 +82,7 @@ namespace AMDiS { ...@@ -82,7 +82,7 @@ namespace AMDiS {
MSG("end of iteration number: %d\n", MSG("end of iteration number: %d\n",
adaptInfo->getTimestepNumber() + 1); adaptInfo->getTimestepNumber() + 1);
MSG("==================================================\n"); MSG("==================================================\n");
}; }
/// Returns number of managed problems /// Returns number of managed problems
...@@ -92,7 +92,7 @@ namespace AMDiS { ...@@ -92,7 +92,7 @@ namespace AMDiS {
for (size_t i = 0; i < problems.size(); ++i) for (size_t i = 0; i < problems.size(); ++i)
num += problems[i]->getNumProblems(); num += problems[i]->getNumProblems();
return num; return num;
}; }
/** \brief /** \brief
...@@ -116,7 +116,7 @@ namespace AMDiS { ...@@ -116,7 +116,7 @@ namespace AMDiS {
if (probIter == NULL) if (probIter == NULL)
throw(std::runtime_error("Problem not found. Should not happen, since number is in range.")); throw(std::runtime_error("Problem not found. Should not happen, since number is in range."));
return probIter; return probIter;
}; }
/// Returns the name of the problem. /// Returns the name of the problem.
...@@ -126,7 +126,7 @@ namespace AMDiS { ...@@ -126,7 +126,7 @@ namespace AMDiS {
throw(std::runtime_error("Problem number out of range.")); throw(std::runtime_error("Problem number out of range."));
return problems[number]->getName(); return problems[number]->getName();
}; }
void CouplingIterationInterface::setSolveProblem(std::string name, bool flag) void CouplingIterationInterface::setSolveProblem(std::string name, bool flag)
...@@ -137,6 +137,6 @@ namespace AMDiS { ...@@ -137,6 +137,6 @@ namespace AMDiS {
break; break;
} }
} }
}; }
} // namespace AMDiS } // namespace AMDiS
...@@ -106,7 +106,7 @@ namespace AMDiS { ...@@ -106,7 +106,7 @@ namespace AMDiS {
void DOFAdmin::freeDofIndex(int dof) 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(usedCount > 0)("No DOFs in use!\n");
TEST_EXIT_DBG(dof >= 0 && dof < size)("Invalid DOF index %d!\n", dof); TEST_EXIT_DBG(dof >= 0 && dof < size)("Invalid DOF index %d!\n", dof);
...@@ -135,7 +135,7 @@ namespace AMDiS { ...@@ -135,7 +135,7 @@ namespace AMDiS {
int DOFAdmin::getDOFIndex() int DOFAdmin::getDOFIndex()
{ {
FUNCNAME("DOFAdmin::getDOFIndex()"); FUNCNAME_DBG("DOFAdmin::getDOFIndex()");
int dof = 0; int dof = 0;
// if there is a hole // if there is a hole
...@@ -174,9 +174,7 @@ namespace AMDiS { ...@@ -174,9 +174,7 @@ namespace AMDiS {
void DOFAdmin::enlargeDofLists(int minsize) void DOFAdmin::enlargeDofLists(int minsize)
{ {
FUNCNAME("DOFAdmin::enlargeDofLists()");
int old = size; int old = size;
if (minsize > 0) if (minsize > 0)
if (old > minsize) if (old > minsize)
...@@ -235,7 +233,7 @@ namespace AMDiS { ...@@ -235,7 +233,7 @@ namespace AMDiS {
void DOFAdmin::addDOFContainer(DOFContainer* cont) void DOFAdmin::addDOFContainer(DOFContainer* cont)
{ {
FUNCNAME("DOFAdmin::addDOFContainer()"); FUNCNAME_DBG("DOFAdmin::addDOFContainer()");
TEST_EXIT_DBG(cont)("no container\n"); TEST_EXIT_DBG(cont)("no container\n");
...@@ -262,7 +260,7 @@ namespace AMDiS { ...@@ -262,7 +260,7 @@ namespace AMDiS {
void DOFAdmin::compress(std::vector<DegreeOfFreedom> &newDofIndex) void DOFAdmin::compress(std::vector<DegreeOfFreedom> &newDofIndex)
{ {
FUNCNAME("DOFAdmin::compress()"); FUNCNAME_DBG("DOFAdmin::compress()");
// nothing to do ? // nothing to do ?
if (size < 1 || usedCount < 1 || holeCount < 1) if (size < 1 || usedCount < 1 || holeCount < 1)
...@@ -321,7 +319,7 @@ namespace AMDiS { ...@@ -321,7 +319,7 @@ namespace AMDiS {
void DOFAdmin::setNumberOfDofs(int i, int v) 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"); TEST_EXIT_DBG(0 <= i && 4 > i)("Should not happen!\n");
...@@ -331,7 +329,7 @@ namespace AMDiS { ...@@ -331,7 +329,7 @@ namespace AMDiS {
void DOFAdmin::setNumberOfPreDofs(int i, int v) 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"); TEST_EXIT_DBG(0 <= i && 4 > i)("Should not happen!\n");
......
...@@ -53,7 +53,7 @@ namespace AMDiS { ...@@ -53,7 +53,7 @@ namespace AMDiS {
*/ */
virtual void compressDofContainer(int size, std::vector<DegreeOfFreedom> &newDOF) virtual void compressDofContainer(int size, std::vector<DegreeOfFreedom> &newDOF)
{ {
FUNCNAME("DOFContainer::compressDofContainer()"); FUNCNAME_DBG("DOFContainer::compressDofContainer()");
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
int j = newDOF[operator[](i)]; int j = newDOF[operator[](i)];
......
...@@ -88,8 +88,6 @@ namespace AMDiS { ...@@ -88,8 +88,6 @@ namespace AMDiS {
DOFMatrix::~DOFMatrix() DOFMatrix::~DOFMatrix()
{ {
FUNCNAME("DOFMatrix::~DOFMatrix()");
if (rowFeSpace && rowFeSpace->getAdmin()) if (rowFeSpace && rowFeSpace->getAdmin())
(const_cast<DOFAdmin*>(rowFeSpace->getAdmin()))->removeDOFIndexed(this); (const_cast<DOFAdmin*>(rowFeSpace->getAdmin()))->removeDOFIndexed(this);
if (boundaryManager) if (boundaryManager)
...@@ -101,8 +99,6 @@ namespace AMDiS { ...@@ -101,8 +99,6 @@ namespace AMDiS {
void DOFMatrix::print() const void DOFMatrix::print() const
{ {
FUNCNAME("DOFMatrix::print()");
if (inserter) if (inserter)
inserter->print(); inserter->print();
} }
...@@ -110,8 +106,6 @@ namespace AMDiS { ...@@ -110,8 +106,6 @@ namespace AMDiS {
bool DOFMatrix::symmetric() bool DOFMatrix::symmetric()
{ {
FUNCNAME("DOFMatrix::symmetric()");
double tol = 1e-5; double tol = 1e-5;
using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end; using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end;
...@@ -177,7 +171,7 @@ namespace AMDiS { ...@@ -177,7 +171,7 @@ namespace AMDiS {