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