Commit cfba5616 authored by Thomas Witkowski's avatar Thomas Witkowski

Changed handling of removing rhs null space in parallel computations for...

Changed handling of removing rhs null space in parallel computations for multiple stationary problems.
parent e77df268
......@@ -57,6 +57,11 @@ namespace AMDiS {
bool createMatrixData = true,
bool storeMatrixData = false);
PetscSolver* getPetscSolver()
{
return petscSolver;
}
protected:
PetscSolver *petscSolver;
......
......@@ -21,12 +21,15 @@ namespace AMDiS {
PetscSolver::PetscSolver()
: meshDistributor(NULL),
mpiRank(-1),
kspPrefix("")
kspPrefix(""),
removeRhsNullSpace(false)
{
string kspStr = "";
Parameters::get("parallel->solver->petsc->ksp", kspStr);
if (kspStr != "")
PetscOptionsInsertString(kspStr.c_str());
Parameters::get("parallel->remove rhs null space", removeRhsNullSpace);
}
......
......@@ -98,6 +98,11 @@ namespace AMDiS {
kspPrefix = s;
}
void setRemoveRhsNullSpace(bool b)
{
removeRhsNullSpace = b;
}
protected:
void printSolutionInfo(AdaptInfo* adaptInfo,
bool iterationCounter = true,
......@@ -149,6 +154,10 @@ namespace AMDiS {
/// KSP database prefix
string kspPrefix;
/// If true, the constant null space is projected out of the RHS vector. It
/// depends on the specific PETSc solver if it considers this value.
bool removeRhsNullSpace;
};
......
......@@ -153,6 +153,7 @@ namespace AMDiS {
VecAssemblyEnd(petscRhsVec);
if (removeRhsNullSpace) {
MSG("Remove constant null space from the RHS!\n");
MatNullSpace sp;
MatNullSpaceCreate(PETSC_COMM_WORLD, PETSC_TRUE, 0, PETSC_NULL, &sp);
MatNullSpaceRemove(sp, petscRhsVec, PETSC_NULL);
......
......@@ -41,14 +41,11 @@ namespace AMDiS {
o_nnz(NULL),
lastMeshNnz(0),
zeroStartVector(false),
alwaysCreateNnzStructure(false),
removeRhsNullSpace(false)
alwaysCreateNnzStructure(false)
{
Parameters::get("parallel->use zero start vector", zeroStartVector);
Parameters::get("parallel->always create nnz structure",
alwaysCreateNnzStructure);
Parameters::get("parallel->remove rhs null space",
removeRhsNullSpace);
}
void fillPetscMatrix(Matrix<DOFMatrix*> *mat);
......@@ -97,9 +94,6 @@ namespace AMDiS {
/// Mapping from global DOF indices to global matrix indices under
/// consideration of possibly multiple components.
DofToMatIndex dofToMatIndex;
/// If true, the constant null space is projected out of the RHS vector.
bool removeRhsNullSpace;
};
......
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