Skip to content
Snippets Groups Projects
Commit 5692afc9 authored by Timo Koch's avatar Timo Koch
Browse files

[amg] Make it possible to reset first call

parent 477abe60
No related branches found
No related tags found
1 merge request!1867Feature/linear solver parallel firstcall
...@@ -64,10 +64,11 @@ public: ...@@ -64,10 +64,11 @@ public:
AMGBiCGSTABBackend(const std::string& paramGroup = "") AMGBiCGSTABBackend(const std::string& paramGroup = "")
: LinearSolver(paramGroup) : LinearSolver(paramGroup)
, isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1) , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1)
, firstCall_(true)
{ {
if (isParallel_) if (isParallel_)
DUNE_THROW(Dune::InvalidStateException, "Using sequential constructor for parallel run. Use signature with gridView and dofMapper!"); DUNE_THROW(Dune::InvalidStateException, "Using sequential constructor for parallel run. Use signature with gridView and dofMapper!");
reset();
} }
/*! /*!
...@@ -83,8 +84,9 @@ public: ...@@ -83,8 +84,9 @@ public:
: LinearSolver(paramGroup) : LinearSolver(paramGroup)
, phelper_(std::make_shared<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper)) , phelper_(std::make_shared<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper))
, isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1) , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1)
, firstCall_(true) {
{} reset();
}
/*! /*!
* \brief Solve a linear system. * \brief Solve a linear system.
...@@ -105,6 +107,12 @@ public: ...@@ -105,6 +107,12 @@ public:
return result_.converged; return result_.converged;
} }
//! reset the linear solver
void reset()
{
firstCall_ = true;
}
/*! /*!
* \brief The name of the solver * \brief The name of the solver
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment