diff --git a/AMDiS/src/Mesh.h b/AMDiS/src/Mesh.h index 10f067efbfdf9f412995d5bb46729af5ba5fc273..c44a3a6923a8b5c8700e9ba57015bf2367c6595e 100644 --- a/AMDiS/src/Mesh.h +++ b/AMDiS/src/Mesh.h @@ -602,8 +602,8 @@ namespace AMDiS { void deleteMeshStructure(); #ifdef HAVE_PARALLEL_DOMAIN_AMDIS - /// In parallel computations the level of all macro elements is equal to the number - /// of global pre refinements, \ref nParallelPreRefinements. + /// In parallel computations the level of all macro elements is equal to the + /// number of global pre refinements, \ref nParallelPreRefinements. inline int getMacroElementLevel() { return nParallelPreRefinements; @@ -741,32 +741,26 @@ namespace AMDiS { /// Number of faces in this Mesh int nFaces; - /** \brief - * Maximal number of elements that share one edge; used to allocate memory - * to store pointers to the neighbour at the refinement/coarsening edge - * (only 3d); - */ + /// Maximal number of elements that share one edge; used to allocate memory + /// to store pointers to the neighbour at the refinement/coarsening edge + /// (only 3d); int maxEdgeNeigh; /// Diameter of the mesh in the DIM_OF_WORLD directions WorldVector<double> diam; - /** \brief - * Is pointer to NULL if mesh contains no parametric elements else pointer - * to a Parametric object containing coefficients of the parameterization - * and related information - */ + /// Is pointer to NULL if mesh contains no parametric elements else pointer + /// to a Parametric object containing coefficients of the parameterization + /// and related information Parametric *parametric; - /** \brief - * When an element is refined, not all dofs of the coarse element must be - * part of the new elements. An example are centered dofs when using higher - * lagrange basis functions. The midpoint dof of the parents element is not - * a dof of the both children elements. Therefore, the dof can be deleted. In - * some situation, e.g., when using multigrid techniques, it can be necessary to - * store this coarse dofs. Then this variable must be set to true. If false, the - * not required coarse dofs will be deleted. - */ + /// When an element is refined, not all dofs of the coarse element must be + /// part of the new elements. An example are centered dofs when using higher + /// lagrange basis functions. The midpoint dof of the parents element is not + /// a dof of the both children elements. Therefore, the dof can be deleted. + /// In some situation, e.g., when using multigrid techniques, it can be + /// necessary to store this coarse dofs. Then this variable must be set to + /// true. If false, the not required coarse dofs will be deleted. bool preserveCoarseDOFs; /// Number of all DOFs on a single element @@ -821,24 +815,20 @@ namespace AMDiS { /// Used by check functions static vector<DegreeOfFreedom> dof_used; - /** \brief - * This map is used for serialization and deserialization of mesh elements. - * During the serialization process, all elements are visited and their dof indices - * are written to the file. If a dof index at a position, i.e. vertex, line or face, - * was written to file, the combination of dof index and position is inserted to - * this map. That ensures that the same dof at the same position, but being part of - * another element, is not written twice to the file. - * When a state should be deserialized, the information can be used to construct - * exactly the same dof structure. - */ + /// This map is used for serialization and deserialization of mesh elements. + /// During the serialization process, all elements are visited and their + /// DOF indices are written to the file. If a dof index at a position, i.e. + /// vertex, line or face, was written to file, the combination of dof index + /// and position is inserted to this map. That ensures that the same dof at + /// the same position, but being part of another element, is not written + /// twice to the file. When a state should be deserialized, the information + /// can be used to construct exactly the same dof structure. static map<pair<DegreeOfFreedom, int>, DegreeOfFreedom*> serializedDOFs; - /** \brief - * Used while mesh refinement. To create new elements - * elementPrototype->clone() is called, which returns a Element of the - * same type as elementPrototype. So e.g. Elements of the different - * dimensions can be created in a uniform way. - */ + /// Used while mesh refinement. To create new elements + /// elementPrototype->clone() is called, which returns a Element of the + /// same type as elementPrototype. So e.g. Elements of the different + /// dimensions can be created in a uniform way. Element* elementPrototype; /// Prototype for leaf data. Used for creation of new leaf data while @@ -875,16 +865,12 @@ namespace AMDiS { /// for findElement-Fcts DimVec<double> final_lambda; - /** \brief - * Temporary variables that are used in functions \ref fineElInfoatPoint and - * \ref fineElementAtPointRecursive. - */ + /// Temporary variables that are used in functions \ref fineElInfoatPoint + /// and \ref fineElementAtPointRecursive. const WorldVector<double> *g_xy0, *g_xy; - /** \brief - * Temporary variable that is used in functions \ref fineElInfoatPoint and - * \ref fineElementAtPointRecursive. - */ + /// Temporary variable that is used in functions \ref fineElInfoatPoint and + /// \ref fineElementAtPointRecursive. double *g_sp; friend class MacroInfo; diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index c297437757124aed29e5d3f41f1627fef7ffe6cd..ca2b0dfff6f935366d64e49ced293594aa601ab8 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -79,6 +79,8 @@ namespace AMDiS { refineManager(NULL), info(10), partitioner(NULL), + dofMap(FESPACE_WISE), + dofMapSd(FESPACE_WISE), deserialized(false), writeSerializationFile(false), repartitioningAllowed(false), diff --git a/AMDiS/src/parallel/ParallelDofMapping.cc b/AMDiS/src/parallel/ParallelDofMapping.cc index 6638d45d9a5b9cca904e4dfdc9ebd72c448ef071..fae072661cba182bbb4dbc13a62166b82294738e 100644 --- a/AMDiS/src/parallel/ParallelDofMapping.cc +++ b/AMDiS/src/parallel/ParallelDofMapping.cc @@ -227,6 +227,32 @@ namespace AMDiS { } + ParallelDofMapping::ParallelDofMapping(DofMappingMode mode) + : levelData(NULL), + dofComm(NULL), + isNonLocal(true), + needMatIndexFromGlobal(false), + nRankDofs(1), + nLocalDofs(1), + nOverallDofs(1), + rStartDofs(1) + { + switch (mode) { + case COMPONENT_WISE: + data = new ComponentDataDiffFeSpace(); + break; + case FESPACE_WISE: + data = new ComponentDataEqFeSpace(); + break; + } + + nRankDofs = -1; + nLocalDofs = -1; + nOverallDofs = -1; + rStartDofs = -1; + } + + void ParallelDofMapping::init(MeshLevelData &ldata, vector<const FiniteElemSpace*> &fe, vector<const FiniteElemSpace*> &uniqueFe, diff --git a/AMDiS/src/parallel/ParallelDofMapping.h b/AMDiS/src/parallel/ParallelDofMapping.h index c170451526d67fa043562146f990c81fcb151db2..33fc94b7afdfcd7073247175a5d2e79e3183a1d3 100644 --- a/AMDiS/src/parallel/ParallelDofMapping.h +++ b/AMDiS/src/parallel/ParallelDofMapping.h @@ -98,11 +98,9 @@ namespace AMDiS { }; - /** - * This class defines the parallel mapping of DOFs for one FE space. It is used - * by the class \ref ParallelDofMapping to specifiy the mapping for a set of - * FE spaces. - */ + /// This class defines the parallel mapping of DOFs for one FE space. It is + /// used by the class \ref ParallelDofMapping to specifiy the mapping for a + /// set of FE spaces. class ComponentDofMap { public: @@ -338,7 +336,7 @@ namespace AMDiS { }; - class ComponentDataEqFeSpace : ComponentDataInterface + class ComponentDataEqFeSpace : public ComponentDataInterface { public: ComponentDataEqFeSpace() @@ -475,7 +473,7 @@ namespace AMDiS { }; - class ComponentDataDiffFeSpace : ComponentDataInterface + class ComponentDataDiffFeSpace : public ComponentDataInterface { public: ComponentDataDiffFeSpace() @@ -574,6 +572,12 @@ namespace AMDiS { friend class Iterator; }; + /// Used to specify whether a parallel DOF mapping is defined for each + /// specific component or for each FE space. + enum DofMappingMode { + COMPONENT_WISE, + FESPACE_WISE + }; /** * Implements the mapping from sets of distributed DOF indices to local and @@ -583,21 +587,7 @@ namespace AMDiS { class ParallelDofMapping { public: - ParallelDofMapping() - : levelData(NULL), - dofComm(NULL), - isNonLocal(true), - needMatIndexFromGlobal(false), - nRankDofs(1), - nLocalDofs(1), - nOverallDofs(1), - rStartDofs(1) - { - nRankDofs = -1; - nLocalDofs = -1; - nOverallDofs = -1; - rStartDofs = -1; - } + ParallelDofMapping(DofMappingMode mode); /** \brief Initialize the parallel DOF mapping. * diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc index e8a7ac4631cd513d3167e2525d79a657b8bc4d79..ce3ffabce74d300fa14a21de6b8b11fc747a17e8 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.cc +++ b/AMDiS/src/parallel/PetscSolverFeti.cc @@ -30,6 +30,12 @@ namespace AMDiS { PetscSolverFeti::PetscSolverFeti() : PetscSolver(), + primalDofMap(COMPONENT_WISE), + dualDofMap(COMPONENT_WISE), + interfaceDofMap(COMPONENT_WISE), + localDofMap(COMPONENT_WISE), + lagrangeMap(COMPONENT_WISE), + interiorDofMap(COMPONENT_WISE), schurPrimalSolver(0), multiLevelTest(false), subdomain(NULL),