From 1a50a838e5b52bb036cceb432acec1ed6e0964b8 Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Thu, 7 May 2009 05:41:32 +0000 Subject: [PATCH] Bugfix when compiling with mpi and some other things ... --- AMDiS/src/AMDiS_fwd.h | 1 + AMDiS/src/CoarseningManager.h | 84 ++++++++---------------------- AMDiS/src/DOFMatrix.cc | 2 +- AMDiS/src/DOFMatrix.h | 6 +-- AMDiS/src/DOFVector.h | 6 +-- AMDiS/src/DOFVector.hh | 2 +- AMDiS/src/DirectSolverInterface.h | 22 -------- AMDiS/src/ElInfo.h | 8 +-- AMDiS/src/ElInfo1d.cc | 39 ++++++++++++++ AMDiS/src/ElInfo1d.h | 10 +++- AMDiS/src/ElInfoStack.h | 49 ++++------------- AMDiS/src/GaussElimination.h | 75 -------------------------- AMDiS/src/Global.h | 24 ++------- AMDiS/src/GlobalDOFNumbering.h | 25 ++------- AMDiS/src/GlobalElementNumbering.h | 34 +++--------- AMDiS/src/LeafData.cc | 6 +-- AMDiS/src/Parametric.h | 41 +++------------ AMDiS/src/ProblemScal.cc | 6 +-- AMDiS/src/ProblemScal.h | 8 +-- AMDiS/src/Recovery.cc | 10 ++-- 20 files changed, 126 insertions(+), 332 deletions(-) delete mode 100644 AMDiS/src/DirectSolverInterface.h delete mode 100644 AMDiS/src/GaussElimination.h diff --git a/AMDiS/src/AMDiS_fwd.h b/AMDiS/src/AMDiS_fwd.h index 33091ba2..ae8b776b 100644 --- a/AMDiS/src/AMDiS_fwd.h +++ b/AMDiS/src/AMDiS_fwd.h @@ -70,6 +70,7 @@ namespace AMDiS { template<typename T> class MatVecMultiplier; template<typename T> class SolverMatrix; template<typename T> class Vector; + template<typename T> class WorldVector; template <typename ITLSolver> class ITL_OEMSolver; diff --git a/AMDiS/src/CoarseningManager.h b/AMDiS/src/CoarseningManager.h index 4e88dcf9..2950709f 100644 --- a/AMDiS/src/CoarseningManager.h +++ b/AMDiS/src/CoarseningManager.h @@ -22,32 +22,13 @@ #ifndef AMDIS_COARSENINGMANAGER_H #define AMDIS_COARSENINGMANAGER_H -// ============================================================================ -// ===== includes ============================================================= -// ============================================================================ - #include "Global.h" #include "Mesh.h" #include "ProblemStatBase.h" +#include "AMDiS_fwd.h" namespace AMDiS { - // ============================================================================ - // ===== forward declarations ================================================= - // ============================================================================ - - class Element; - class Line; - class Triangle; - class Tetrahedron; - class RCNeighbourList; - class ElInfo; - class TraverseStack; - - // ============================================================================ - // ===== class CoarseningManager ============================================== - // ============================================================================ - /** \ingroup Adaption * \brief * Base class of CoarseningManager1d, CoarseningManager2d, CoarseningManager3d. @@ -57,22 +38,19 @@ namespace AMDiS { class CoarseningManager { public: - /** \brief - * constructs a CoarseningManager which belongs to aMesh - */ + /// Constructs a CoarseningManager which belongs to aMesh CoarseningManager() - : mesh(NULL), stack(NULL), globalMark(0), doMore(0) - {}; + : mesh(NULL), + stack(NULL), + globalMark(0), + doMore(0) + {} - /** \brief - * destructor - */ - virtual ~CoarseningManager() {}; + /// destructor + virtual ~CoarseningManager() {} - /** \brief - * Returns the Mesh the CoarseningManager belongs to. - */ - inline Mesh* getMesh() { return mesh; }; + /// Returns the Mesh the CoarseningManager belongs to. + inline Mesh* getMesh() { return mesh; } /** \brief * Tries to coarsen every element of mesh at least mark times. First @@ -108,45 +86,29 @@ namespace AMDiS { */ void spreadCoarsenMark(); - /** \brief - * Used while traversal in spreadCoarsenMark - */ + /// Used while traversal in spreadCoarsenMark static int spreadCoarsenMarkFunction(ElInfo* el_info); - /** \brief - *Used while traversal in cleanUpAfterCoarsen - */ + /// Used while traversal in cleanUpAfterCoarsen static int cleanUpAfterCoarsenFunction(ElInfo* el_info); - /** \brief - * Sets the mark on all elements that have to be coarsend - */ + /// Sets the mark on all elements that have to be coarsend static int coarsenMarkFunction(ElInfo *el_info); - /** \brief - * Resets the element marks - */ + /// Resets the element marks void cleanUpAfterCoarsen(); protected: - /** \brief - * the Mesh this CoarseningManager belongs to - */ - Mesh *mesh; + /// The Mesh this CoarseningManager belongs to. + Mesh *mesh; - /** \brief - * Used for non recursive mesh traversal. - */ + /// Used for non recursive mesh traversal. TraverseStack *stack; - /** \brief - * Used by globalCoarsen to remember the given mark value - */ - int globalMark; + /// Used by globalCoarsen to remember the given mark value + int globalMark; - /** \brief - * Spezifies whether the coarsening operation is still in progress - */ + /// Spezifies whether the coarsening operation is still in progress bool doMore; /** \brief @@ -155,9 +117,7 @@ namespace AMDiS { */ static CoarseningManager* traversePtr; - /** \brief - * Spezifies how many DOFVectors should restricted while coarsening - */ + /// Spezifies how many DOFVectors should restricted while coarsening int callCoarseRestrict; friend class RCNeighbourList; diff --git a/AMDiS/src/DOFMatrix.cc b/AMDiS/src/DOFMatrix.cc index 946d1e58..afa32905 100644 --- a/AMDiS/src/DOFMatrix.cc +++ b/AMDiS/src/DOFMatrix.cc @@ -55,7 +55,7 @@ namespace AMDiS { applyDBCs.clear(); -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS applicationOrdering = NULL; #endif } diff --git a/AMDiS/src/DOFMatrix.h b/AMDiS/src/DOFMatrix.h index 25d51723..6fb48772 100644 --- a/AMDiS/src/DOFMatrix.h +++ b/AMDiS/src/DOFMatrix.h @@ -39,7 +39,7 @@ #include "Boundary.h" #include "Serializable.h" -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #include "petscao.h" #endif @@ -430,7 +430,7 @@ namespace AMDiS { /// int memsize(); -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Sets the petsc application ordering object to map dof indices. void useApplicationOrdering(AO *ao) { applicationOrdering = ao; @@ -495,7 +495,7 @@ namespace AMDiS { */ std::set<int> applyDBCs; -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Petsc application ordering to map dof indices. AO *applicationOrdering; #endif diff --git a/AMDiS/src/DOFVector.h b/AMDiS/src/DOFVector.h index 7acd2856..3b4bcbf9 100644 --- a/AMDiS/src/DOFVector.h +++ b/AMDiS/src/DOFVector.h @@ -41,7 +41,7 @@ #include "DOFMatrix.h" #include "BasisFunction.h" -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #include "petscao.h" #endif @@ -517,7 +517,7 @@ namespace AMDiS { DOFVector<WorldVector<T> >* getRecoveryGradient(DOFVector<WorldVector<T> >*) const; -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Sets the petsc application ordering object to map dof indices. void useApplicationOrdering(AO *ao) { applicationOrdering = ao; @@ -559,7 +559,7 @@ namespace AMDiS { /// Used for mesh traversal static DOFVector<T> *traverseVector; -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Petsc application ordering to map dof indices. AO *applicationOrdering; #endif diff --git a/AMDiS/src/DOFVector.hh b/AMDiS/src/DOFVector.hh index 68967f90..04cd7c62 100644 --- a/AMDiS/src/DOFVector.hh +++ b/AMDiS/src/DOFVector.hh @@ -116,7 +116,7 @@ namespace AMDiS { { init(f, n); -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS applicationOrdering = NULL; #endif } diff --git a/AMDiS/src/DirectSolverInterface.h b/AMDiS/src/DirectSolverInterface.h deleted file mode 100644 index cb78c18c..00000000 --- a/AMDiS/src/DirectSolverInterface.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef AMDIS_DIRECTSOLVERINTERFACE_H -#define AMDIS_DIRECTSOLVERINTERFACE_H - -namespace AMDiS { - - template<typename MatrixType, typename VectorType> - class DirectSolverInterface - { - public: - DirectSolverInterface() {}; - - virtual ~DirectSolverInterface() {}; - - virtual void solve(MatrixType &A, - VectorType &b, - VectorType &x, - int numUnknowns) = 0; - }; - -} - -#endif diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h index aaf75891..9841046b 100644 --- a/AMDiS/src/ElInfo.h +++ b/AMDiS/src/ElInfo.h @@ -319,14 +319,9 @@ namespace AMDiS { void coordToWorld(const DimVec<double>& lambda, WorldVector<double>& world) const; - - /** \brief - * Fills ElInfo's \ref det_ and \ref grdLambda entries. - */ + /// Fills ElInfo's \ref det_ and \ref grdLambda entries. virtual void fillDetGrdLambda(); - // ===== pure virtual functions. Must be overriden in sub-classes ============ - /** \brief * Returns a pointer to a vector, which contains the barycentric coordinates * with respect to \ref element of a point with world coordinates world. @@ -488,7 +483,6 @@ namespace AMDiS { */ DimMat<double> *subElemCoordsMat; - // ===== static public members ================================================ public: /** \brief * child_vertex[el_type][child][i] = father's local vertex index of new diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc index b2a2eb8c..910ac24b 100644 --- a/AMDiS/src/ElInfo1d.cc +++ b/AMDiS/src/ElInfo1d.cc @@ -289,6 +289,16 @@ namespace AMDiS { } } + void ElInfo1d::getRefSimplexCoords(const BasisFunction *basisFcts, + mtl::dense2D<double>& coords) const + { + TEST_EXIT(basisFcts->getDegree() == 1)("Wrong basis function degree!\n"); + + double deg1[][2] = {{ 1.0, 0.0 }, + { 0.0, 1.0 }}; + coords = deg1; + } + void ElInfo1d::getSubElementCoords(const BasisFunction *basisFcts, int iChild, DimMat<double> *coords) const @@ -312,4 +322,33 @@ namespace AMDiS { } } + void ElInfo1d::getSubElementCoords(const BasisFunction *basisFcts, + int iChild, + mtl::dense2D<double>& coords) const + { + FUNCNAME("ElInfo1d::getSubElementCoords()"); + + double deg1_left[][2] = {{ 1.0, 0.5 }, + { 0.0, 0.5 }}; + mtl::dense2D<double> deg1_left_mat(deg1_left); + + double deg1_right[][2] = {{ 0.5, 1.0 }, + { 0.5, 0.0 }}; + mtl::dense2D<double> deg1_right_mat(deg1_right); + + switch (basisFcts->getDegree()) { + case 1: + if (iChild == 0) + coords *= deg1_left_mat; + else + coords *= deg1_right_mat; + + break; + case 2: + break; + default: + ERROR_EXIT("Not yet implemented!\n"); + } + } + } diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h index 81bdd5ce..dee1d7ec 100644 --- a/AMDiS/src/ElInfo1d.h +++ b/AMDiS/src/ElInfo1d.h @@ -22,6 +22,8 @@ #ifndef AMDIS_ELINFO1D_H #define AMDIS_ELINFO1D_H +#include <boost/numeric/mtl/mtl.hpp> + #include "ElInfo.h" #include "MemoryManager.h" @@ -34,8 +36,6 @@ namespace AMDiS { class ElInfo1d : public ElInfo { public: - MEMORY_MANAGED(ElInfo1d); - /// Constructor. Calls ElInfo's protected Constructor. ElInfo1d(Mesh* aMesh) : ElInfo(aMesh) @@ -66,10 +66,16 @@ namespace AMDiS { void getRefSimplexCoords(const BasisFunction *basisFcts, DimMat<double> *coords) const; + void getRefSimplexCoords(const BasisFunction *basisFcts, + mtl::dense2D<double>& coords) const; + void getSubElementCoords(const BasisFunction *basisFcts, int iChild, DimMat<double> *coords) const; + void getSubElementCoords(const BasisFunction *basisFcts, + int iChild, + mtl::dense2D<double>& coords) const; }; } diff --git a/AMDiS/src/ElInfoStack.h b/AMDiS/src/ElInfoStack.h index c7d46234..b528c0a4 100644 --- a/AMDiS/src/ElInfoStack.h +++ b/AMDiS/src/ElInfoStack.h @@ -22,78 +22,47 @@ #ifndef AMDIS_ELINFOSTACK_H #define AMDIS_ELINFOSTACK_H -// ============================================================================ -// ===== includes ============================================================= -// ============================================================================ #include <vector> #include "ElInfo.h" +#include "AMDiS_fwd.h" namespace AMDiS { - // ============================================================================ - // ===== forward declarations ================================================= - // ============================================================================ - - class Mesh; - - - // ============================================================================ - // ===== class ElInfoStack ==================================================== - // ============================================================================ - /** \ingroup Traverse * \brief * Stores a stack of ElInfo object. Is used by meshes for recursive mesh * traverse. The use of a stack is cheaper than allocating the ElInfo objects * at every recursive step. */ - class ElInfoStack { public: - /** \brief - * Constructer, creates the stack. - */ + /// Constructer, creates the stack. ElInfoStack(Mesh *mesh); - /** \brief - * Destructor, deletes all ElInfos on the stack. - */ + /// Destructor, deletes all ElInfos on the stack. ~ElInfoStack(); - /** \brief - * Get a new element from the stack an increase the stack position. - */ + /// Get a new element from the stack an increase the stack position. ElInfo* getNextElement(); - /** \brief - * Decrease the stack position. - */ + /// Decrease the stack position. void getBackElement(); - /** \brief - * Returns a pointer to the currently used element of the stack. - */ + /// Returns a pointer to the currently used element of the stack. ElInfo* getCurrentElement(); protected: - /** \brief - * The mesh on which the traverse is done. - */ + /// The mesh on which the traverse is done. Mesh *mesh_; - /** \brief - * The stack of pointers to ElInfo objects. - */ + /// The stack of pointers to ElInfo objects. std::vector<ElInfo*> elInfoStack_; - /** \brief - * Current position (depth) of the recursive mesh traverse. - */ + /// Current position (depth) of the recursive mesh traverse. int stackPosition_; }; } - #endif // AMDIS_ELINFOSTACK_H diff --git a/AMDiS/src/GaussElimination.h b/AMDiS/src/GaussElimination.h deleted file mode 100644 index 49d3b856..00000000 --- a/AMDiS/src/GaussElimination.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef AMDIS_GAUSSELIMINATION_H -#define AMDIS_GAUSSELIMINATION_H - -#include "DirectSolverInterface.h" -#include "Global.h" -#include "MemoryManager.h" - -namespace AMDiS -{ - template<typename MatrixType, typename VectorType> - class GaussElimination : public DirectSolverInterface<MatrixType, VectorType> - { - public: - MEMORY_MANAGED(GaussElimination<MatrixType COMMA VectorType>); - - GaussElimination() {}; - - virtual ~GaussElimination() {}; - - void solve(MatrixType &a, VectorType &b, VectorType &x, int n) - { - FUNCNAME("GaussElimination::solve()"); - - int i, j, k, row; - double a_ji, max, tmp = 0.0; - - // forward elimination - for(i = 0; i < n - 1; i++) { - - // pivoting - max = abs(a[i][i]); - row = i; - - for(j = i + 1; j < n; j++) { - if(abs(a[j][i]) > max) { - max = abs(a[j][i]); - row = j; - } - } - - TEST_EXIT(max > 0.0)("pivoting failed (max entry = 0)\n"); - - if(row != i) { - tmp = b[i]; - b[i] = b[row]; - b[row] = tmp; - for(j = 0; j < n; j++) { - tmp = a[i][j]; - a[i][j] = a[row][j]; - a[row][j] = tmp; - } - } - - // make zeros - for(j = i + 1; j < n; j++) { - a_ji = (a[j][i] /= a[i][i]); - for(k = i; k < n; k++) { - a[j][k] -= a_ji * a[i][k]; - } - b[j] -= a_ji * b[i]; - } - } - - // backward elimination - for(i = n - 1; i >= 0; i--) { - for(j = i + 1; j < n; j++) { - b[i] -= a[i][j] * x[j]; - } - x[i] = b[i] / a[i][i]; - } - }; - }; -} - -#endif diff --git a/AMDiS/src/Global.h b/AMDiS/src/Global.h index b3681f9d..406365ae 100644 --- a/AMDiS/src/Global.h +++ b/AMDiS/src/Global.h @@ -38,10 +38,6 @@ /** \brief current AMDiS version */ #define AMDIS_VERSION "AMDiS: Version 0.100" -// ============================================================================ -// ===== includes ============================================================= -// ============================================================================ - #include <string> #include <vector> #include <fstream> @@ -51,13 +47,9 @@ #include <functional> #include <float.h> -namespace AMDiS { - // ============================================================================ - // ===== forward declarations ================================================= - // ============================================================================ +#include "AMDiS_fwd.h" - class Mesh; - class Element; +namespace AMDiS { extern const char *funcName; @@ -139,9 +131,6 @@ namespace AMDiS { #define DBL_TOL DBL_EPSILON #define FLT_TOL FLT_EPSILON - // ============================================================================ - // ===== class Msg ============================================================ - // ============================================================================ /** \brief * Manages the output of messages, warnings, errors, ... @@ -270,8 +259,10 @@ namespace AMDiS { /// In debug mode, it corresponds to ERROR_EXIT, otherwise it is noop. #if (DEBUG == 0) #define TEST_EXIT_DBG(test) if (false) Msg::catch_error_exit + #define DBG_VAR(var) #else #define TEST_EXIT_DBG(test) if ((test));else ERROR_EXIT + #define DBG_VAR(var) var #endif /// prints a message @@ -337,9 +328,6 @@ namespace AMDiS { #define MAXPART FACE #define MINPART PROJECTION - // ============================================================================ - // ===== class Global ========================================================= - // ============================================================================ /** \ingroup Common * \brief @@ -359,9 +347,7 @@ namespace AMDiS { return referenceElement[dim]; } - /** \brief - * returns geometrical information. Currently this is only dimOfWorld. - */ + /// returns geometrical information. Currently this is only dimOfWorld. static inline int getGeo(GeoIndex p) { if (WORLD == p) return dimOfWorld; diff --git a/AMDiS/src/GlobalDOFNumbering.h b/AMDiS/src/GlobalDOFNumbering.h index ed3cbb63..dede578d 100644 --- a/AMDiS/src/GlobalDOFNumbering.h +++ b/AMDiS/src/GlobalDOFNumbering.h @@ -22,24 +22,13 @@ #ifndef AMDIS_GLOBALDOFNUMBERING_H #define AMDIS_GLOBALDOFNUMBERING_H -// =========================================================================== -// ===== includes ============================================================ -// =========================================================================== #include <map> #include <vector> #include "Global.h" +#include "AMDiS_fwd.h" namespace AMDiS { - // ========================================================================= - // ===== forward declarations ============================================== - // ========================================================================= - class MeshStructure; - - // ========================================================================= - // ===== class GlobalDOFNumbering ====================================== - // ========================================================================= - /** \ingroup Parallel * \brief * Creates a global DOF numbering. @@ -47,21 +36,15 @@ namespace AMDiS { class GlobalDOFNumbering { public: - /** \brief - * Constructor - */ + /// Constructor GlobalDOFNumbering(std::vector<MeshStructure*> &meshCodes, std::vector< std::vector<DegreeOfFreedom> > &dofCodes, int dofsPerElement); - /** \brief - * Returns the local index of rank corresponding to global index. - */ + /// Returns the local index of rank corresponding to global index. int getLocalIndex(int rank, int globalIndex); - /** \brief - * Returns the global index corresponing to local index of rank. - */ + /// Returns the global index corresponing to local index of rank. int getGlobalIndex(int rank, int localIndex); protected: diff --git a/AMDiS/src/GlobalElementNumbering.h b/AMDiS/src/GlobalElementNumbering.h index 800d4768..c2e9a280 100644 --- a/AMDiS/src/GlobalElementNumbering.h +++ b/AMDiS/src/GlobalElementNumbering.h @@ -22,23 +22,11 @@ #ifndef AMDIS_GLOBALELEMENTNUMBERING_H #define AMDIS_GLOBALELEMENTNUMBERING_H -// =========================================================================== -// ===== includes ============================================================ -// =========================================================================== #include <map> +#include "AMDiS_fwd.h" namespace AMDiS { - // ========================================================================= - // ===== forward declarations ============================================== - // ========================================================================= - class MeshStructure; - class Mesh; - - // ========================================================================= - // ===== class GlobalElementNumbering ====================================== - // ========================================================================= - /** \ingroup Parallel * \brief * Creates a global element numbering. @@ -46,31 +34,21 @@ namespace AMDiS { class GlobalElementNumbering { public: - /** \brief - * Constructor - */ + /// Constructor GlobalElementNumbering(MeshStructure *compositeStructure, Mesh *localMesh); - /** \brief - * Returns the local index corresponding to local index. - */ + /// Returns the local index corresponding to local index. int getLocalIndex(int globalIndex); - /** \brief - * Returns the global index corresponing to local index. - */ + /// Returns the global index corresponing to local index. int getGlobalIndex(int localIndex); protected: - /** \brief - * Maps each local index to its global index. - */ + /// Maps each local index to its global index. std::map<int, int> localToGlobal_; - /** \brief - * Stores local index for each global index. - */ + /// Stores local index for each global index. std::map<int, int> globalToLocal_; }; diff --git a/AMDiS/src/LeafData.cc b/AMDiS/src/LeafData.cc index 4a78281e..f29d3e7f 100644 --- a/AMDiS/src/LeafData.cc +++ b/AMDiS/src/LeafData.cc @@ -61,7 +61,7 @@ namespace AMDiS { int elTypeParent) { - bool test = otherChild->deleteElementData(ESTIMATABLE); + DBG_VAR(bool test =) otherChild->deleteElementData(ESTIMATABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataEstimatableVec at otherChild"); parent->setElementData(NEW LeafDataEstimatableVec(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); @@ -83,7 +83,7 @@ namespace AMDiS { Element* otherChild, int elTypeParent) { - bool test = otherChild->deleteElementData(COARSENABLE); + DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenable at otherChild"); parent->setElementData(NEW LeafDataCoarsenable(parent->getElementData())); @@ -106,7 +106,7 @@ namespace AMDiS { Element* otherChild, int elTypeParent) { - bool test = otherChild->deleteElementData(COARSENABLE); + DBG_VAR(bool test =) otherChild->deleteElementData(COARSENABLE); TEST_EXIT_DBG(test)("couldn't delete LeafDataCoarsenableVec at otherChild"); parent->setElementData(NEW LeafDataCoarsenableVec(parent->getElementData())); ElementData::coarsenElementData(parent, thisChild, otherChild, elTypeParent); diff --git a/AMDiS/src/Parametric.h b/AMDiS/src/Parametric.h index 9b135689..34de0f9e 100644 --- a/AMDiS/src/Parametric.h +++ b/AMDiS/src/Parametric.h @@ -23,21 +23,10 @@ #define AMDIS_PARAMETRIC_H #include "MemoryManager.h" +#include "AMDiS_fwd.h" namespace AMDiS { - // ============================================================================ - // ===== forward declarations ================================================= - // ============================================================================ - - class ElInfo; - template<typename T> class DOFVector; - template<typename T> class WorldVector; - - // ============================================================================ - // ===== class Parametric ===================================================== - // ============================================================================ - /** \brief * Interface for parametric elements. A Parametric object can be given to * a Mesh. @@ -45,7 +34,7 @@ namespace AMDiS { */ class Parametric { public: - virtual ~Parametric() {}; + virtual ~Parametric() {} /** \brief * Can return a pointer to a new parametric ElInfo or the original pointer @@ -74,39 +63,25 @@ namespace AMDiS { virtual ElInfo *removeParametricInfo(ElInfo *elInfo) = 0; }; - // ============================================================================ - // ===== class ParametricFirstOrder =========================================== - // ============================================================================ - - /** \brief - * Implementation of linear parametric elements. - */ + /// Implementation of linear parametric elements. class ParametricFirstOrder : public Parametric { public: MEMORY_MANAGED(ParametricFirstOrder); - /** \brief - * Constructor. \ref dofCoords are set to coords. - */ + /// Constructor. \ref dofCoords are set to coords. ParametricFirstOrder(WorldVector<DOFVector<double>*> *coords) : dofCoords_(coords) - {}; + {} - /** \brief - * Implementation of \ref Parametric::addParametricInfo(). - */ + /// Implementation of \ref Parametric::addParametricInfo(). ElInfo *addParametricInfo(ElInfo *elInfo); - /** \brief - * Implementation of \ref Parametric::removeParametricInfo(). - */ + /// Implementation of \ref Parametric::removeParametricInfo(). ElInfo *removeParametricInfo(ElInfo *elInfo); protected: - /** \brief - * Pointer to a DOFVector of world coordinates. - */ + /// Pointer to a DOFVector of world coordinates. WorldVector<DOFVector<double>*> *dofCoords_; }; diff --git a/AMDiS/src/ProblemScal.cc b/AMDiS/src/ProblemScal.cc index cd9cf55b..bfacb520 100644 --- a/AMDiS/src/ProblemScal.cc +++ b/AMDiS/src/ProblemScal.cc @@ -142,7 +142,7 @@ namespace AMDiS { rhs->getBoundaryManager()->addBoundaryCondition(periodic); } -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS void ProblemScal::useApplicationOrdering(AO *ao) { applicationOrdering = ao; @@ -538,7 +538,7 @@ namespace AMDiS { clock_t first = clock(); -#ifndef HAVE_PARALLEL_AMDIS +#ifndef HAVE_PARALLEL_DOMAIN_AMDIS mesh->dofCompress(); #endif @@ -617,7 +617,7 @@ namespace AMDiS { INFO(info, 8)("buildAfterCoarsen needed %.5f seconds\n", TIME_USED(first,clock())); -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS // PetscErrorCode ierr; // Mat A; diff --git a/AMDiS/src/ProblemScal.h b/AMDiS/src/ProblemScal.h index 87d54dd9..c4231bab 100644 --- a/AMDiS/src/ProblemScal.h +++ b/AMDiS/src/ProblemScal.h @@ -33,7 +33,7 @@ #include "Boundary.h" #include "StandardProblemIteration.h" -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #include "petscao.h" #endif @@ -62,7 +62,7 @@ namespace AMDiS { useGetBound(true), refinementManager(NULL), coarseningManager(NULL), -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS applicationOrdering(NULL), #endif info(10) @@ -207,7 +207,7 @@ namespace AMDiS { /// Adds periodic boundary conditions. virtual void addPeriodicBC(BoundaryType type); -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Sets the petsc application ordering object to map dof indices. void useApplicationOrdering(AO *ao); #endif @@ -371,7 +371,7 @@ namespace AMDiS { */ CoarseningManager *coarseningManager; -#ifdef HAVE_PARALLEL_AMDIS +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS /// Petsc application ordering to map dof indices. AO *applicationOrdering; #endif diff --git a/AMDiS/src/Recovery.cc b/AMDiS/src/Recovery.cc index bfe4a3e7..e7c6af1b 100644 --- a/AMDiS/src/Recovery.cc +++ b/AMDiS/src/Recovery.cc @@ -914,9 +914,10 @@ Recovery::recovery(DOFVector<double> *uh, const FiniteElemSpace *fe_space, // Solving local systems. for (SV_it.reset(); !SV_it.end(); ++SV_it) { if ((*SV_it).A) { - int error = Cholesky::solve((*SV_it).A, - (*SV_it).rec_grdUh, - (*SV_it).rec_grdUh); + DBG_VAR(int error =) + Cholesky::solve((*SV_it).A, + (*SV_it).rec_grdUh, + (*SV_it).rec_grdUh); TEST_EXIT_DBG(error) ("There must be some error, matrix is not positive definite.\n"); } @@ -932,9 +933,8 @@ Recovery::recovery(DOFVector<double> *uh, const FiniteElemSpace *fe_space, vec = NULL; } - if (!vec) { + if (!vec) vec = NEW DOFVector<WorldVector<double> >(feSpace, "gradient"); - } result = vec; -- GitLab