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 {
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;
......
......@@ -79,6 +79,8 @@ namespace AMDiS {
refineManager(NULL),
info(10),
partitioner(NULL),
dofMap(FESPACE_WISE),
dofMapSd(FESPACE_WISE),
deserialized(false),
writeSerializationFile(false),
repartitioningAllowed(false),
......
......@@ -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,
......
......@@ -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.
*
......
......@@ -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),
......
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