Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

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

Fixed some issues for multi level tests.

parent 4e34df55
...@@ -1223,7 +1223,7 @@ namespace AMDiS { ...@@ -1223,7 +1223,7 @@ namespace AMDiS {
if (list->getNeighbourElement(i, 1) && list->getNeighbourNr(i, 1) < i) if (list->getNeighbourElement(i, 1) && list->getNeighbourNr(i, 1) < i)
lr_set += 2; lr_set += 2;
TEST_EXIT(lr_set > 0) TEST_EXIT(lr_set > 0)
("No values set on both neighbours of element %d\n", el->getIndex()); ("No values set on both neighbours of element %d\n", el->getIndex());
......
...@@ -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();
...@@ -569,7 +568,7 @@ namespace AMDiS { ...@@ -569,7 +568,7 @@ namespace AMDiS {
dofMaps.end()) dofMaps.end())
("Parallel DOF mapping already registerd in mesh distributor object!\n"); ("Parallel DOF mapping already registerd in mesh distributor object!\n");
dofMaps.push_back(&dofMap); dofMaps.push_back(&dofMap);
} }
......
...@@ -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,11 +331,13 @@ namespace AMDiS { ...@@ -331,11 +331,13 @@ 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);
}
}
} }
...@@ -1047,7 +1049,7 @@ namespace AMDiS { ...@@ -1047,7 +1049,7 @@ namespace AMDiS {
MatMatMult(subdomain->getMatCoarseInterior(), matK, MAT_INITIAL_MATRIX, MatMatMult(subdomain->getMatCoarseInterior(), matK, MAT_INITIAL_MATRIX,
PETSC_DEFAULT, &mat_schur_primal); PETSC_DEFAULT, &mat_schur_primal);
MatAYPX(mat_schur_primal, -1.0, subdomain->getMatCoarse(), DIFFERENT_NONZERO_PATTERN); MatAYPX(mat_schur_primal, -1.0, subdomain->getMatCoarse(), DIFFERENT_NONZERO_PATTERN);
MatDestroy(&matK); MatDestroy(&matK);
} else { } else {
Mat tmp; Mat tmp;
......
...@@ -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);
......
...@@ -203,8 +203,8 @@ namespace AMDiS { ...@@ -203,8 +203,8 @@ namespace AMDiS {
rStartInterior; rStartInterior;
MatSetValues(getMatCoarseInteriorByComponent(rowComponent), MatSetValues(getMatCoarseInteriorByComponent(rowComponent),
1, &rowIndex, colsOther.size(), 1, &rowIndex, colsOther.size(),
&(colsOther[0]), &(valuesOther[0]), ADD_VALUES); &(colsOther[0]), &(valuesOther[0]), ADD_VALUES);
} }
} else { } else {
if ((*interiorMap)[rowComponent].isSet(*cursor) == false) if ((*interiorMap)[rowComponent].isSet(*cursor) == false)
...@@ -222,8 +222,8 @@ namespace AMDiS { ...@@ -222,8 +222,8 @@ namespace AMDiS {
cols[i] = interiorMap->getMatIndex(colComponent, cols[i]); cols[i] = interiorMap->getMatIndex(colComponent, cols[i]);
} }
MatSetValues(getMatInterior(), 1, &localRowIndex, cols.size(), MatSetValues(getMatInterior(), 1, &localRowIndex, cols.size(),
&(cols[0]), &(values[0]), ADD_VALUES); &(cols[0]), &(values[0]), ADD_VALUES);
if (colsOther.size()) { if (colsOther.size()) {
int globalRowIndex = int globalRowIndex =
...@@ -234,8 +234,8 @@ namespace AMDiS { ...@@ -234,8 +234,8 @@ namespace AMDiS {
colCoarseSpace->getMatIndex(colComponent, colsOther[i]); colCoarseSpace->getMatIndex(colComponent, colsOther[i]);
MatSetValues(getMatInteriorCoarseByComponent(colComponent), MatSetValues(getMatInteriorCoarseByComponent(colComponent),
1, &globalRowIndex, colsOther.size(), 1, &globalRowIndex, colsOther.size(),
&(colsOther[0]), &(valuesOther[0]), ADD_VALUES); &(colsOther[0]), &(valuesOther[0]), ADD_VALUES);
} }
} }
} }
...@@ -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