From 90357cd5767abe53463c21fbabb3b41bf89c4960 Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Fri, 20 Apr 2012 08:17:45 +0000 Subject: [PATCH] Added flags for compiling with Intel C++ compiler. Fixed some real compiler warnings. --- AMDiS/CMakeLists.txt | 15 +++----- AMDiS/src/DOFMatrix.h | 2 ++ AMDiS/src/ProblemInstat.h | 3 +- AMDiS/src/ProblemInterpol.cc | 4 +-- AMDiS/src/ProblemInterpol.h | 11 ++++-- AMDiS/src/io/GNUPlotWriter.cc | 4 ++- AMDiS/src/io/GNUPlotWriter.h | 5 ++- AMDiS/src/nonlin/ProblemNonLin.cc | 2 +- AMDiS/src/nonlin/ProblemNonLin.h | 2 +- AMDiS/src/parallel/MeshDistributor.cc | 4 +-- AMDiS/src/parallel/MeshDistributor.h | 7 ++++ AMDiS/src/parallel/MeshPartitioner.h | 8 ++--- AMDiS/src/parallel/ParMetisPartitioner.cc | 2 +- AMDiS/src/parallel/ParMetisPartitioner.h | 2 +- AMDiS/src/parallel/ParallelDebug.cc | 11 +++--- AMDiS/src/parallel/ParallelDofMapping.cc | 24 ++++++++++--- AMDiS/src/parallel/ParallelDofMapping.h | 15 +++----- AMDiS/src/parallel/ParallelTypes.h | 10 +++++- AMDiS/src/parallel/PetscSolver.cc | 1 + AMDiS/src/parallel/PetscSolver.h | 5 ++- AMDiS/src/parallel/PetscSolverFeti.cc | 34 +++++++------------ AMDiS/src/parallel/PetscSolverGlobalMatrix.cc | 1 + AMDiS/src/time/RosenbrockAdaptInstationary.cc | 2 +- 23 files changed, 100 insertions(+), 74 deletions(-) diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt index 4c77ee6a..fcc68229 100644 --- a/AMDiS/CMakeLists.txt +++ b/AMDiS/CMakeLists.txt @@ -31,7 +31,11 @@ if(CMAKE_BUILD_TYPE STREQUAL "") set(CMAKE_BUILD_TYPE "Release") endif() -#option(ENABLE_INTEL "use intel compiler" false) +if(CMAKE_CXX_COMPILER MATCHES ".*icpc") + Message("Compiler: Intel") + set(CMAKE_CXX_FLAGS "-diag-disable 654 -diag-disable 858") +endif() + SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" ) option(USE_PETSC_DEV false) option(ENABLE_ZOLTAN false) @@ -39,15 +43,6 @@ option(ENABLE_UMFPACK "Use of UMFPACK solver" false) option(ENABLE_PNG "use png reader/writer" false) option(ENABLE_BDDCML "Use of BDDCML library" false) -if(ENABLE_INTEL) - Message("please set the icc manually") - INCLUDE (CMakeForceCompiler) - CMAKE_FORCE_C_COMPILER(icc "intel C compiler") - CMAKE_FORCE_CXX_COMPILER(icpc "intel C++ compiler") - #SET(CMAKE_C_COMPILER "icc") -endif(ENABLE_INTEL) - - find_package(Boost 1.42 REQUIRED) if(Boost_FOUND) list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) diff --git a/AMDiS/src/DOFMatrix.h b/AMDiS/src/DOFMatrix.h index 2c3095ce..5105828e 100644 --- a/AMDiS/src/DOFMatrix.h +++ b/AMDiS/src/DOFMatrix.h @@ -262,12 +262,14 @@ namespace AMDiS { inserter= 0; } +#if 0 /// Returns whether restriction should be performed after coarsening /// (false by default) virtual bool coarseRestrict() { return false; } +#endif /// Returns const \ref rowFeSpace const FiniteElemSpace* getRowFeSpace() const diff --git a/AMDiS/src/ProblemInstat.h b/AMDiS/src/ProblemInstat.h index 6d4ff02a..7bd6e230 100644 --- a/AMDiS/src/ProblemInstat.h +++ b/AMDiS/src/ProblemInstat.h @@ -93,7 +93,8 @@ namespace AMDiS { } /// Implementation of ProblemTimeInterface::closeTimestep(). - virtual void closeTimestep() {} + virtual void closeTimestep(AdaptInfo *adaptInfo) + {} /// Returns \ref name. inline std::string getName() diff --git a/AMDiS/src/ProblemInterpol.cc b/AMDiS/src/ProblemInterpol.cc index 4b479f23..af718351 100644 --- a/AMDiS/src/ProblemInterpol.cc +++ b/AMDiS/src/ProblemInterpol.cc @@ -35,7 +35,7 @@ namespace AMDiS { } - void ProblemInterpol::solve(AdaptInfo *adaptInfo) + void ProblemInterpol::solve(AdaptInfo *adaptInfo, bool, bool) { int size = static_cast<int>(meshes.size()); for (int i = 0; i < size; i++) @@ -45,7 +45,7 @@ namespace AMDiS { } - void ProblemInterpol::estimate(AdaptInfo *adaptInfo, double) + void ProblemInterpol::estimate(AdaptInfo *adaptInfo) { FUNCNAME("ProblemIterpolVec::estimate()"); diff --git a/AMDiS/src/ProblemInterpol.h b/AMDiS/src/ProblemInterpol.h index abead27b..80b07d7e 100644 --- a/AMDiS/src/ProblemInterpol.h +++ b/AMDiS/src/ProblemInterpol.h @@ -50,13 +50,18 @@ namespace AMDiS { virtual void buildbeforeCoarsen(AdaptInfo *adaptInfo, Flag) {} /// No system assemblage. - virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag) {} + virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag, + bool assembleMatrix = true, + bool assembleVector = true) + {} /// No equation system ins solved. Instead fct is interpolated to uh. - virtual void solve(AdaptInfo *adaptInfo); + virtual void solve(AdaptInfo *adaptInfo, + bool createMatrixData = true, + bool storeMatrixData = false); /// True H1 or L2 error is calculated. - virtual void estimate(AdaptInfo *adaptInfo, double); + virtual void estimate(AdaptInfo *adaptInfo); protected: /// Function to interpolate. diff --git a/AMDiS/src/io/GNUPlotWriter.cc b/AMDiS/src/io/GNUPlotWriter.cc index 02483b8c..211c4f4a 100644 --- a/AMDiS/src/io/GNUPlotWriter.cc +++ b/AMDiS/src/io/GNUPlotWriter.cc @@ -31,7 +31,9 @@ namespace AMDiS { filename = fn; } - void GNUPlotWriter::writeFiles(AdaptInfo *adaptInfo, bool force) + + void GNUPlotWriter::writeFiles(AdaptInfo *adaptInfo, bool force, + int, Flag, bool (*)(ElInfo*)) { DOFVector<WorldVector<double> > coords(feSpace_, "coords"); Mesh *mesh = feSpace_->getMesh(); diff --git a/AMDiS/src/io/GNUPlotWriter.h b/AMDiS/src/io/GNUPlotWriter.h index 737220fb..9f203ebf 100644 --- a/AMDiS/src/io/GNUPlotWriter.h +++ b/AMDiS/src/io/GNUPlotWriter.h @@ -43,7 +43,10 @@ namespace AMDiS { virtual ~GNUPlotWriter() {} /// - virtual void writeFiles(AdaptInfo *adaptInfo, bool force); + virtual void writeFiles(AdaptInfo *adaptInfo, bool force, + int level = -1, + Flag traverseFlag = Mesh::CALL_LEAF_EL, + bool (*writeElem)(ElInfo*) = NULL); protected: /// Contains the mesh diff --git a/AMDiS/src/nonlin/ProblemNonLin.cc b/AMDiS/src/nonlin/ProblemNonLin.cc index e5c5f312..ec1e30de 100644 --- a/AMDiS/src/nonlin/ProblemNonLin.cc +++ b/AMDiS/src/nonlin/ProblemNonLin.cc @@ -19,7 +19,7 @@ namespace AMDiS { void ProblemNonLin::initialize(Flag initFlag, - ProblemStat *adoptProblem /*= NULL*/, + ProblemStatSeq *adoptProblem /*= NULL*/, Flag adoptFlag /*= INIT_NOTHING*/) { FUNCNAME("ProblemNonLin::initialize()"); diff --git a/AMDiS/src/nonlin/ProblemNonLin.h b/AMDiS/src/nonlin/ProblemNonLin.h index f370b41d..fbe8f387 100644 --- a/AMDiS/src/nonlin/ProblemNonLin.h +++ b/AMDiS/src/nonlin/ProblemNonLin.h @@ -77,7 +77,7 @@ namespace AMDiS { /// Initialization of the problem. virtual void initialize(Flag initFlag, - ProblemStat *adoptProblem = NULL, + ProblemStatSeq *adoptProblem = NULL, Flag adoptFlag = INIT_NOTHING); /// Used in \ref initialize(). diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index d54cd0e7..35a0a8f0 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -969,7 +969,7 @@ namespace AMDiS { // (static_cast<double>(maxDofs - avrgDofs) / avrgDofs) * 100.0; double imbalance1 = (static_cast<double>(maxDofs) / minDofs - 1.0) * 100.0; - MSG("Imbalancing factor: %.1f\%\n", imbalance1); + MSG("Imbalancing factor: %.1f\n", imbalance1); } } @@ -2264,7 +2264,7 @@ namespace AMDiS { { FUNCNAME("MeshDistributor::mapGlobalToLocal()"); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap[feSpace].getMap().begin(); + for (DofMap::iterator it = dofMap[feSpace].getMap().begin(); it != dofMap[feSpace].getMap().end(); ++it) if (it->second.global == dof) return it->first; diff --git a/AMDiS/src/parallel/MeshDistributor.h b/AMDiS/src/parallel/MeshDistributor.h index 9bb6d721..3d2756b1 100644 --- a/AMDiS/src/parallel/MeshDistributor.h +++ b/AMDiS/src/parallel/MeshDistributor.h @@ -225,6 +225,12 @@ namespace AMDiS { return dofMap[feSpace][dof].local; } + /// Returns the DOF mapping object, \ref dofMap. + inline ParallelDofMapping& getDofMap() + { + return dofMap; + } + /// Returns the periodic mapping handler, \ref periodicMap. inline PeriodicMap& getPeriodicMap() { @@ -555,6 +561,7 @@ namespace AMDiS { /// macro element. map<int, int> partitionMap; + /// Mapping object to map from local DOF indices to global ones. ParallelDofMapping dofMap; /// Database to store and query all sub-objects of all elements of the diff --git a/AMDiS/src/parallel/MeshPartitioner.h b/AMDiS/src/parallel/MeshPartitioner.h index 9e20ddef..e79edfc1 100644 --- a/AMDiS/src/parallel/MeshPartitioner.h +++ b/AMDiS/src/parallel/MeshPartitioner.h @@ -107,11 +107,7 @@ namespace AMDiS { boxPartitioning = b; } -#if 0 - void setLocalGlobalDofMap(map<DegreeOfFreedom, DegreeOfFreedom> *m) -#else - void setLocalGlobalDofMap(map<DegreeOfFreedom, MultiIndex> *m) -#endif + void setLocalGlobalDofMap(DofMap *m) { mapLocalGlobal = m; } @@ -173,7 +169,7 @@ namespace AMDiS { /// macro element index the box number it belongs to. map<int, int> elInBox; - map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal; + DofMap *mapLocalGlobal; map<int, vector<int> > elNeighbours; diff --git a/AMDiS/src/parallel/ParMetisPartitioner.cc b/AMDiS/src/parallel/ParMetisPartitioner.cc index 4c7e2b8c..359ee3ad 100644 --- a/AMDiS/src/parallel/ParMetisPartitioner.cc +++ b/AMDiS/src/parallel/ParMetisPartitioner.cc @@ -29,7 +29,7 @@ namespace AMDiS { ParMetisMesh::ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm, std::map<int, bool>& elementInRank, - map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal) + DofMap *mapLocalGlobal) : dim(mesh->getDim()), nElements(0), mpiComm(comm) diff --git a/AMDiS/src/parallel/ParMetisPartitioner.h b/AMDiS/src/parallel/ParMetisPartitioner.h index c95798a5..982ca347 100644 --- a/AMDiS/src/parallel/ParMetisPartitioner.h +++ b/AMDiS/src/parallel/ParMetisPartitioner.h @@ -44,7 +44,7 @@ namespace AMDiS { public: ParMetisMesh(Mesh *mesh, MPI::Intracomm *comm, map<int, bool>& elementInRank, - map<DegreeOfFreedom, MultiIndex> *mapLocalGlobal); + DofMap *mapLocalGlobal); ~ParMetisMesh(); diff --git a/AMDiS/src/parallel/ParallelDebug.cc b/AMDiS/src/parallel/ParallelDebug.cc index 4405af98..66f8c1f3 100644 --- a/AMDiS/src/parallel/ParallelDebug.cc +++ b/AMDiS/src/parallel/ParallelDebug.cc @@ -640,20 +640,21 @@ namespace AMDiS { cout << "====== DOF MAP LOCAL -> GLOBAL ====== " << endl; - map<DegreeOfFreedom, MultiIndex> &dofMap = pdb.dofMap[feSpace].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); - it != dofMap.end(); ++it) { + DofMap &dofMap = pdb.dofMap[feSpace].getMap(); + for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) { cout << "DOF " << it->first << " " << it->second.global << "\n"; WorldVector<double> coords; pdb.mesh->getDofIndexCoords(it->first, feSpace, coords); coords.print(); - for (DofComm::Iterator rit(pdb.sendDofs, feSpace); !rit.end(); rit.nextRank()) + for (DofComm::Iterator rit(pdb.sendDofs, feSpace); + !rit.end(); rit.nextRank()) for (; !rit.endDofIter(); rit.nextDof()) if (it->first == rit.getDofIndex()) cout << "SEND DOF TO " << rit.getRank() << endl; - for (DofComm::Iterator rit(pdb.recvDofs, feSpace); !rit.end(); rit.nextRank()) + for (DofComm::Iterator rit(pdb.recvDofs, feSpace); + !rit.end(); rit.nextRank()) for (; !rit.endDofIter(); rit.nextDof()) if (it->first == rit.getDofIndex()) cout << "RECV DOF FROM " << rit.getRank() << endl; diff --git a/AMDiS/src/parallel/ParallelDofMapping.cc b/AMDiS/src/parallel/ParallelDofMapping.cc index 63290e2e..e62df99a 100644 --- a/AMDiS/src/parallel/ParallelDofMapping.cc +++ b/AMDiS/src/parallel/ParallelDofMapping.cc @@ -32,7 +32,7 @@ namespace AMDiS { { // === Compute local indices for all rank owned DOFs. === - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); it != dofMap.end(); ++it) + for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) if (it->second.local == -1 && nonRankDofs.count(it->first) == 0) it->second.local = nRankDofs++; @@ -55,7 +55,7 @@ namespace AMDiS { void FeSpaceDofMap::computeGlobalMapping() { - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); it != dofMap.end(); ++it) + for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) it->second.global = it->second.local + rStartDofs; } @@ -255,6 +255,21 @@ namespace AMDiS { computeMatIndex(); } + + void ParallelDofMapping::update(vector<const FiniteElemSpace*>& fe) + { + FUNCNAME("ParallelDofMapping::update()"); + + for (vector<const FiniteElemSpace*>::iterator it = fe.begin(); + it != fe.end(); ++it) + if (find(feSpacesUnique.begin(), feSpacesUnique.end(), *it) == + feSpacesUnique.end()) + ERROR_EXIT("Wrong FE space!\n"); + + feSpaces = fe; + update(); + } + void ParallelDofMapping::computeMatIndex() { @@ -274,9 +289,8 @@ namespace AMDiS { // Traverse all DOFs of the FE space and create for all rank owned DOFs // a matrix index. - map<DegreeOfFreedom, MultiIndex>& dofMap = data[feSpaces[i]].getMap(); - typedef map<DegreeOfFreedom, MultiIndex>::iterator ItType; - for (ItType it = dofMap.begin(); it != dofMap.end(); ++it) { + DofMap& dofMap = data[feSpaces[i]].getMap(); + for (DofMap::iterator it = dofMap.begin(); it != dofMap.end(); ++it) { if (data[feSpaces[i]].isRankDof(it->first)) { int globalMatIndex = it->second.local + offset; dofToMatIndex.add(i, it->first, globalMatIndex); diff --git a/AMDiS/src/parallel/ParallelDofMapping.h b/AMDiS/src/parallel/ParallelDofMapping.h index 63ebf27d..40d603fe 100644 --- a/AMDiS/src/parallel/ParallelDofMapping.h +++ b/AMDiS/src/parallel/ParallelDofMapping.h @@ -35,14 +35,6 @@ namespace AMDiS { using namespace std; - /// Is used if a DOF index is mapped to multiple indices, i.e., to both, a local - /// and a global one. - struct MultiIndex - { - int local, global; - }; - - /** \brief * Is used to store matrix indices to all DOFs in rank's subdomain. Thus, the * class defines a mapping from component number and DOF index to a global @@ -183,7 +175,7 @@ namespace AMDiS { } /// Returns the raw data of the mapping. - map<DegreeOfFreedom, MultiIndex>& getMap() + DofMap& getMap() { return dofMap; } @@ -237,7 +229,7 @@ namespace AMDiS { const FiniteElemSpace *feSpace; /// Mapping data from DOF indices to local and global indices. - map<DegreeOfFreedom, MultiIndex> dofMap; + DofMap dofMap; /// Set of all DOFs that are in mapping but are not owned by the rank. std::set<DegreeOfFreedom> nonRankDofs; @@ -348,6 +340,9 @@ namespace AMDiS { /// Update the mapping. void update(); + /// Update the mapping. + void update(vector<const FiniteElemSpace*>& feSpaces); + /// Returns the global matrix index of a given DOF for a given /// component number. inline int getMatIndex(int ithComponent, DegreeOfFreedom d) diff --git a/AMDiS/src/parallel/ParallelTypes.h b/AMDiS/src/parallel/ParallelTypes.h index 43edc233..2d170bc9 100644 --- a/AMDiS/src/parallel/ParallelTypes.h +++ b/AMDiS/src/parallel/ParallelTypes.h @@ -70,7 +70,15 @@ namespace AMDiS { /// need to have a periodic DOF mapping for each FE space. typedef std::map<const FiniteElemSpace*, PeriodicDofMap> PeriodicDofMapFeSpace; - + /// Is used if a DOF index is mapped to multiple indices, i.e., to both, a local + /// and a global one. + struct MultiIndex + { + int local, global; + }; + + typedef std::map<DegreeOfFreedom, MultiIndex> DofMap; + typedef vector<MeshStructure> MeshCodeVec; } diff --git a/AMDiS/src/parallel/PetscSolver.cc b/AMDiS/src/parallel/PetscSolver.cc index 21af3441..a4c1aebc 100644 --- a/AMDiS/src/parallel/PetscSolver.cc +++ b/AMDiS/src/parallel/PetscSolver.cc @@ -20,6 +20,7 @@ namespace AMDiS { PetscSolver::PetscSolver() : meshDistributor(NULL), + dofMap(NULL), mpiRank(-1), kspPrefix(""), removeRhsNullSpace(false) diff --git a/AMDiS/src/parallel/PetscSolver.h b/AMDiS/src/parallel/PetscSolver.h index 1c985d15..56f7c652 100644 --- a/AMDiS/src/parallel/PetscSolver.h +++ b/AMDiS/src/parallel/PetscSolver.h @@ -53,6 +53,7 @@ namespace AMDiS { void setMeshDistributor(MeshDistributor *m) { meshDistributor = m; + dofMap = &(meshDistributor->getDofMap()); mpiRank = meshDistributor->getMpiRank(); mpiComm = meshDistributor->getMpiComm(); mpiSelfComm = PETSC_COMM_SELF; @@ -138,7 +139,9 @@ namespace AMDiS { protected: MeshDistributor *meshDistributor; - + + ParallelDofMapping *dofMap; + int mpiRank; MPI::Intracomm mpiComm; diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc index e0ab38be..2dcbfd93 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.cc +++ b/AMDiS/src/parallel/PetscSolverFeti.cc @@ -420,8 +420,8 @@ namespace AMDiS { // === appropriate number of Lagrange constraints. === int nRankLagrange = 0; - map<DegreeOfFreedom, MultiIndex>& dualMap = dualDofMap[feSpace].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dualMap.begin(); it != dualMap.end(); ++it) { + DofMap& dualMap = dualDofMap[feSpace].getMap(); + for (DofMap::iterator it = dualMap.begin(); it != dualMap.end(); ++it) { if (meshDistributor->getIsRankDof(feSpace, it->first)) { lagrangeMap[feSpace].insertRankDof(it->first, nRankLagrange); int degree = boundaryDofRanks[feSpace][it->first].size(); @@ -460,7 +460,7 @@ namespace AMDiS { // === And finally, add the global indicies of all dual nodes. === - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dualDofMap[feSpace].getMap().begin(); + for (DofMap::iterator it = dualDofMap[feSpace].getMap().begin(); it != dualDofMap[feSpace].getMap().end(); ++it) localDofMap[feSpace].insertRankDof(it->first); } @@ -486,11 +486,9 @@ namespace AMDiS { // === constraint. === for (unsigned int k = 0; k < feSpaces.size(); k++) { - map<DegreeOfFreedom, MultiIndex> &dualMap = - dualDofMap[feSpaces[k]].getMap(); + DofMap &dualMap = dualDofMap[feSpaces[k]].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dualMap.begin(); - it != dualMap.end(); ++it) { + for (DofMap::iterator it = dualMap.begin(); it != dualMap.end(); ++it) { TEST_EXIT_DBG(boundaryDofRanks[feSpaces[k]].count(it->first)) ("Should not happen!\n"); @@ -735,10 +733,8 @@ namespace AMDiS { &(fetiDirichletPreconData.tmp_vec_interior)); for (unsigned int i = 0; i < feSpaces.size(); i++) { - map<DegreeOfFreedom, MultiIndex> &dualMap = - dualDofMap[feSpaces[i]].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dualMap.begin(); - it != dualMap.end(); ++it) { + DofMap &dualMap = dualDofMap[feSpaces[i]].getMap(); + for (DofMap::iterator it = dualMap.begin(); it != dualMap.end(); ++it) { DegreeOfFreedom d = it->first; int matIndexLocal = localDofMap.getLocalMatIndex(i, d); int matIndexDual = dualDofMap.getLocalMatIndex(i, d); @@ -758,10 +754,8 @@ namespace AMDiS { fetiLumpedPreconData.mat_duals_duals = &mat_duals_duals; for (unsigned int i = 0; i < feSpaces.size(); i++) { - map<DegreeOfFreedom, MultiIndex> &dualMap = - dualDofMap[feSpaces[i]].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dualMap.begin(); - it != dualMap.end(); ++it) { + DofMap &dualMap = dualDofMap[feSpaces[i]].getMap(); + for (DofMap::iterator it = dualMap.begin(); it != dualMap.end(); ++it) { DegreeOfFreedom d = it->first; int matIndexLocal = localDofMap.getLocalMatIndex(i, d); int matIndexDual = dualDofMap.getLocalMatIndex(i, d); @@ -865,10 +859,8 @@ namespace AMDiS { { int cnt = 0; for (unsigned int i = 0; i < feSpaces.size(); i++) { - map<DegreeOfFreedom, MultiIndex>& dofMap = - primalDofMap[feSpaces[i]].getMap(); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = dofMap.begin(); - it != dofMap.end(); ++it) { + DofMap& dofMap = primalDofMap[feSpaces[i]].getMap(); + for (DofMap::iterator it = dofMap.begin();it != dofMap.end(); ++it) { globalIsIndex.push_back(primalDofMap.getMatIndex(i, it->first)); localIsIndex.push_back(cnt++); } @@ -913,13 +905,13 @@ namespace AMDiS { for (int i = 0; i < vec.getSize(); i++) { DOFVector<double>& dofVec = *(vec.getDOFVector(i)); - for (map<DegreeOfFreedom, MultiIndex>::iterator it = localDofMap[feSpaces[i]].getMap().begin(); + for (DofMap::iterator it = localDofMap[feSpaces[i]].getMap().begin(); it != localDofMap[feSpaces[i]].getMap().end(); ++it) { int petscIndex = localDofMap.getLocalMatIndex(i, it->first); dofVec[it->first] = localSolB[petscIndex]; } - for (map<DegreeOfFreedom, MultiIndex>::iterator it = primalDofMap[feSpaces[i]].getMap().begin(); + for (DofMap::iterator it = primalDofMap[feSpaces[i]].getMap().begin(); it != primalDofMap[feSpaces[i]].getMap().end(); ++it) dofVec[it->first] = localSolPrimal[cnt++]; } diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc index fb8c0ac5..acaca222 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc @@ -22,6 +22,7 @@ namespace AMDiS { FUNCNAME("PetscSolverGlobalMatrix::fillPetscMatrix()"); TEST_EXIT_DBG(meshDistributor)("No mesh distributor object defined!\n"); + TEST_EXIT_DBG(dofMap)("No parallel mapping object defined!\n"); TEST_EXIT_DBG(mat)("No DOF matrix defined!\n"); double wtime = MPI::Wtime(); diff --git a/AMDiS/src/time/RosenbrockAdaptInstationary.cc b/AMDiS/src/time/RosenbrockAdaptInstationary.cc index c46fd0e1..0cb1b938 100644 --- a/AMDiS/src/time/RosenbrockAdaptInstationary.cc +++ b/AMDiS/src/time/RosenbrockAdaptInstationary.cc @@ -118,7 +118,7 @@ namespace AMDiS { bool rejected = false; double timeTol = adaptInfo->getTimeTolerance(0); - size_t studyTimestep = -1; + int studyTimestep = -1; do { if (dbgTimestepStudy) { -- GitLab