Commit 1908148a authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Fixed some issues for multi level tests.

parent 4e34df55
...@@ -123,6 +123,23 @@ namespace AMDiS { ...@@ -123,6 +123,23 @@ namespace AMDiS {
} }
void MSMarker::initMarking(AdaptInfo *adaptInfo, Mesh *mesh)
{
FUNCNAME("MSMarker::initMarking()");
Marker::initMarking(adaptInfo, mesh);
double MSGammaP = pow(MSGamma, p);
double MSGammaCP = pow(MSGammaC, p);
markRLimit = MSGammaP * adaptInfo->getEstMax(row == -1 ? 0 : row);
markCLimit = MSGammaCP * adaptInfo->getEstMax(row == -1 ? 0 : row);
MSG("start max_est: %.3le mark_limits: %.3le %.3le\n",
adaptInfo->getEstMax(row == -1 ? 0 : row), markRLimit, markCLimit);
}
void ESMarker::initMarking(AdaptInfo *adaptInfo, Mesh *mesh) void ESMarker::initMarking(AdaptInfo *adaptInfo, Mesh *mesh)
{ {
FUNCNAME("ESMarker::initMarking()"); FUNCNAME("ESMarker::initMarking()");
......
...@@ -217,16 +217,7 @@ namespace AMDiS { ...@@ -217,16 +217,7 @@ namespace AMDiS {
} }
/// Implementation of MarkScal::initMarking(). /// Implementation of MarkScal::initMarking().
virtual void initMarking(AdaptInfo *adaptInfo, Mesh *mesh) void initMarking(AdaptInfo *adaptInfo, Mesh *mesh);
{
Marker::initMarking(adaptInfo, mesh);
double MSGammaP = pow(MSGamma, p);
double MSGammaCP = pow(MSGammaC, p);
markRLimit = MSGammaP * adaptInfo->getEstMax(row == -1 ? 0 : row);
markCLimit = MSGammaCP * adaptInfo->getEstMax(row == -1 ? 0 : row);
}
protected: protected:
/// Marking parameter. /// Marking parameter.
......
...@@ -133,6 +133,9 @@ namespace AMDiS { ...@@ -133,6 +133,9 @@ namespace AMDiS {
Parameters::get(name + "->print timings", printTimings); Parameters::get(name + "->print timings", printTimings);
TEST_EXIT(partitioner)("Could not create partitioner \"%s\"!\n", partStr.c_str()); TEST_EXIT(partitioner)("Could not create partitioner \"%s\"!\n", partStr.c_str());
// If required, create hierarchical mesh level structure.
createMeshLevelStructure();
} }
...@@ -179,15 +182,11 @@ namespace AMDiS { ...@@ -179,15 +182,11 @@ namespace AMDiS {
elObjDb.setFeSpace(feSpaces[0]); elObjDb.setFeSpace(feSpaces[0]);
// If required, create hierarchical mesh level structure.
createMeshLevelStructure();
// If the problem has been already read from a file, we need only to set // If the problem has been already read from a file, we need only to set
// isRankDofs to all matrices and rhs vector and to remove periodic // isRankDofs to all matrices and rhs vector and to remove periodic
// boundary conditions (if there are some). // boundary conditions (if there are some).
if (deserialized) { if (deserialized) {
createMeshLevelStructure();
updateMacroElementInfo(); updateMacroElementInfo();
removePeriodicBoundaryConditions(); removePeriodicBoundaryConditions();
......
...@@ -72,7 +72,10 @@ namespace AMDiS { ...@@ -72,7 +72,10 @@ namespace AMDiS {
MPI::Intracomm& getMpiComm(int level) MPI::Intracomm& getMpiComm(int level)
{ {
TEST_EXIT_DBG(level < nLevel)("Should not happen!\n"); FUNCNAME("MeshLevelData::getMpiComm()");
TEST_EXIT_DBG(level < nLevel)
("Asked for level %d, but defined only for %d levels!\n", level, nLevel);
return mpiComms[level]; return mpiComms[level];
} }
......
...@@ -927,6 +927,9 @@ namespace AMDiS { ...@@ -927,6 +927,9 @@ namespace AMDiS {
Mesh *mesh = feSpace->getMesh(); Mesh *mesh = feSpace->getMesh();
if (mesh->getDim() != 3)
return;
stringstream filename; stringstream filename;
filename << prefix << "-" << MPI::COMM_WORLD.Get_rank() << "." << postfix; filename << prefix << "-" << MPI::COMM_WORLD.Get_rank() << "." << postfix;
......
...@@ -48,8 +48,9 @@ namespace AMDiS { ...@@ -48,8 +48,9 @@ namespace AMDiS {
PetscSolver::~PetscSolver() PetscSolver::~PetscSolver()
{ {
if (parallelDofMappingsRegistered) { if (parallelDofMappingsRegistered) {
meshDistributor->removeDofMap(dofMap);
int nLevels = meshDistributor->getMeshLevelData().getLevelNumber(); int nLevels = meshDistributor->getMeshLevelData().getLevelNumber();
meshDistributor->removeDofMap(dofMap);
if (nLevels > 1) if (nLevels > 1)
meshDistributor->removeDofMap(dofMapSd); meshDistributor->removeDofMap(dofMapSd);
} }
......
...@@ -150,6 +150,11 @@ namespace AMDiS { ...@@ -150,6 +150,11 @@ namespace AMDiS {
return dofMap; return dofMap;
} }
ParallelDofMapping& getDofMapSd()
{
return dofMapSd;
}
vector<const FiniteElemSpace*>& getComponentSpaces() vector<const FiniteElemSpace*>& getComponentSpaces()
{ {
return componentSpaces; return componentSpaces;
......
...@@ -331,12 +331,14 @@ namespace AMDiS { ...@@ -331,12 +331,14 @@ namespace AMDiS {
// === Calculate the number of primals that are owned by the rank and === // === Calculate the number of primals that are owned by the rank and ===
// === create local indices of the primals starting at zero. === // === create local indices of the primals starting at zero. ===
for (DofIndexSet::iterator it = primals.begin(); it != primals.end(); ++it) for (DofIndexSet::iterator it = primals.begin(); it != primals.end(); ++it) {
if (dofMap[feSpace].isRankDof(*it)) { if (dofMap[feSpace].isRankDof(*it)) {
primalDofMap[component].insertRankDof(*it); primalDofMap[component].insertRankDof(*it);
} else } else {
primalDofMap[component].insertNonRankDof(*it); primalDofMap[component].insertNonRankDof(*it);
} }
}
}
void PetscSolverFeti::createDuals(int component) void PetscSolverFeti::createDuals(int component)
......
...@@ -57,6 +57,11 @@ namespace AMDiS { ...@@ -57,6 +57,11 @@ namespace AMDiS {
/// Constructor of FETI-DP solver class. /// Constructor of FETI-DP solver class.
PetscSolverFeti(string name); PetscSolverFeti(string name);
/// After mesh changes, or if the solver is called the first time, this
/// function creates all information about primal nodes, dual nodes and
/// lagrange constraints.
void createFetiData();
/// Assemble the sequentially created matrices to the global matrices /// Assemble the sequentially created matrices to the global matrices
/// required by the FETI-DP method. /// required by the FETI-DP method.
void fillPetscMatrix(Matrix<DOFMatrix*> *mat); void fillPetscMatrix(Matrix<DOFMatrix*> *mat);
...@@ -115,11 +120,6 @@ namespace AMDiS { ...@@ -115,11 +120,6 @@ namespace AMDiS {
/// ///
void createDirichletData(Matrix<DOFMatrix*> &mat); void createDirichletData(Matrix<DOFMatrix*> &mat);
/// After mesh changes, or if the solver is called the first time, this
/// function creates all information about primal nodes, dual nodes and
/// lagrange constraints.
void createFetiData();
/// Defines which boundary nodes are primal. Creates global index of /// Defines which boundary nodes are primal. Creates global index of
/// the primal variables. /// the primal variables.
void createPrimals(int component); void createPrimals(int component);
......
...@@ -244,6 +244,7 @@ namespace AMDiS { ...@@ -244,6 +244,7 @@ namespace AMDiS {
matAssembly(); matAssembly();
// === Create solver for the non primal (thus local) variables. === // === Create solver for the non primal (thus local) variables. ===
KSPCreate(mpiCommLocal, &kspInterior); KSPCreate(mpiCommLocal, &kspInterior);
......
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