Commit b19c99d6 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added switch between zero and non zero start vector for PETSc.

parent 6e0803ed
......@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host deimos101:
# Libtool was configured on host p1q024:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host deimos101:
# Libtool was configured on host p1q024:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host deimos101:
# Libtool was configured on host p1q024:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......
......@@ -587,14 +587,16 @@ namespace AMDiS {
FUNCNAME("PetscProblemStat::solvePetscMatrix()");
// === Set old solution to be initiual guess for PETSc solver. ===
VecSet(petscSolVec, 0.0);
for (int i = 0; i < nComponents; i++)
setDofVector(petscSolVec, vec.getDOFVector(i), nComponents, i, true);
VecAssemblyBegin(petscSolVec);
VecAssemblyEnd(petscSolVec);
if (!zeroStartVector) {
VecSet(petscSolVec, 0.0);
for (int i = 0; i < nComponents; i++)
setDofVector(petscSolVec, vec.getDOFVector(i), nComponents, i, true);
VecAssemblyBegin(petscSolVec);
VecAssemblyEnd(petscSolVec);
}
// === Init PETSc solver. ===
......@@ -607,7 +609,8 @@ namespace AMDiS {
delete petscSolver;
// Do not delete the solution vector, use it for the initial guess.
KSPSetInitialGuessNonzero(solver, PETSC_TRUE);
if (!zeroStartVector)
KSPSetInitialGuessNonzero(solver, PETSC_TRUE);
// === Run PETSc. ===
......
......@@ -44,8 +44,11 @@ namespace AMDiS {
: ParallelProblemStatBase(nameStr, problemIteration),
d_nnz(NULL),
o_nnz(NULL),
lastMeshNnz(0)
{}
lastMeshNnz(0),
zeroStartVector(false)
{
GET_PARAMETER(0, "parallel->use zero start vector", "%d", &zeroStartVector);
}
~PetscProblemStat()
{}
......@@ -97,6 +100,8 @@ namespace AMDiS {
* therefore also the assembled matrix structure.
*/
int lastMeshNnz;
bool zeroStartVector;
};
typedef PetscProblemStat ParallelProblemStat;
......
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