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 {
}
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)
{
FUNCNAME("ESMarker::initMarking()");
......
......@@ -217,16 +217,7 @@ namespace AMDiS {
}
/// Implementation of MarkScal::initMarking().
virtual 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);
}
void initMarking(AdaptInfo *adaptInfo, Mesh *mesh);
protected:
/// Marking parameter.
......
......@@ -133,6 +133,9 @@ namespace AMDiS {
Parameters::get(name + "->print timings", printTimings);
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 {
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
// isRankDofs to all matrices and rhs vector and to remove periodic
// boundary conditions (if there are some).
if (deserialized) {
createMeshLevelStructure();
updateMacroElementInfo();
removePeriodicBoundaryConditions();
......
......@@ -72,7 +72,10 @@ namespace AMDiS {
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];
}
......
......@@ -927,6 +927,9 @@ namespace AMDiS {
Mesh *mesh = feSpace->getMesh();
if (mesh->getDim() != 3)
return;
stringstream filename;
filename << prefix << "-" << MPI::COMM_WORLD.Get_rank() << "." << postfix;
......
......@@ -48,8 +48,9 @@ namespace AMDiS {
PetscSolver::~PetscSolver()
{
if (parallelDofMappingsRegistered) {
meshDistributor->removeDofMap(dofMap);
int nLevels = meshDistributor->getMeshLevelData().getLevelNumber();
meshDistributor->removeDofMap(dofMap);
if (nLevels > 1)
meshDistributor->removeDofMap(dofMapSd);
}
......
......@@ -150,6 +150,11 @@ namespace AMDiS {
return dofMap;
}
ParallelDofMapping& getDofMapSd()
{
return dofMapSd;
}
vector<const FiniteElemSpace*>& getComponentSpaces()
{
return componentSpaces;
......
......@@ -331,12 +331,14 @@ namespace AMDiS {
// === Calculate the number of primals that are owned by the rank and ===
// === 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)) {
primalDofMap[component].insertRankDof(*it);
} else
} else {
primalDofMap[component].insertNonRankDof(*it);
}
}
}
void PetscSolverFeti::createDuals(int component)
......
......@@ -57,6 +57,11 @@ namespace AMDiS {
/// Constructor of FETI-DP solver class.
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
/// required by the FETI-DP method.
void fillPetscMatrix(Matrix<DOFMatrix*> *mat);
......@@ -115,11 +120,6 @@ namespace AMDiS {
///
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
/// the primal variables.
void createPrimals(int component);
......
......@@ -244,6 +244,7 @@ namespace AMDiS {
matAssembly();
// === Create solver for the non primal (thus local) variables. ===
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