Skip to content

Commit

Permalink
[stella_solver.c] stella_solve(): reuse solution at subsequent iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Spies committed Dec 11, 2018
1 parent 5ee10e7 commit 56e20d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stella_solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ PetscErrorCode stella_solve(stella *slv)

// Temporarily signal bcs have changed to be safe
ierr = stella_changed_bc(slv);CHKERRQ(ierr);
ierr = VecSet(slv->x, 0);CHKERRQ(ierr);
// Reuse previous solution at subsequent iteration
if(slv->ts == 1) {
ierr = VecSet(slv->x, 0);CHKERRQ(ierr);
}
if (!slv->options.algebraic && cedar_direct) {
PC bmg_pc;
ierr = KSPGetPC(slv->ksp, &bmg_pc);CHKERRQ(ierr);
Expand Down

0 comments on commit 56e20d5

Please sign in to comment.