Skip to content
Snippets Groups Projects
Commit c0cf499b authored by Simone Bnà's avatar Simone Bnà
Browse files

BUG: removed contexts.removeContext at the end of Foam::petscSolver::solve

parent dc1d99dd
Branches
Tags
No related merge requests found
......@@ -115,14 +115,17 @@ Foam::solverPerformance Foam::petscSolver::solve
if (!ctx.initialized())
{
if (debug)
{
Info<< "Initializing PETSc Linear Solver " << eqName_ << nl;
}
ctx.initialized() = true;
needsCacheUpdate = false;
computeMatAllocation(Amat);
buildMat(Amat);
buildKsp(Amat, ksp);
Info<< "Initializing PETSc Linear Solver " << eqName_ << nl;
}
const bool caching
......@@ -132,13 +135,15 @@ Foam::solverPerformance Foam::petscSolver::solve
if (!caching && needsCacheUpdate)
{
if (debug)
{
Info<< "Updating cached PETSc Linear Solver " << eqName_ << nl;
}
buildMat(Amat);
updateKsp(Amat, ksp);
Info<< "Update cached PETSc Linear Solver " << eqName_ << nl;
}
// Solver name from petsc dictionary
const word solverName
(
......@@ -237,13 +242,6 @@ Foam::solverPerformance Foam::petscSolver::solve
VecDestroy(&petsc_source);
#endif
if (!caching)
{
contexts.removeContext(eqName_);
Info<< "Removing cached PETSc Linear Solver " << eqName_ << nl;
}
// Return solver performance to OpenFOAM
return solverPerf;
}
......
......@@ -74,8 +74,6 @@ public:
//- Destructor
virtual ~petscLinearSolverContext()
{
Info<< "Destroying PETSc Linear Solver Context" << nl;
if (init_)
{
MatDestroy(&Amat);
......
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