Commit bb968a2c authored by Thomas Witkowski's avatar Thomas Witkowski

Fixed last issues in code change of parallel DOF mapping, now go on for debugging.

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