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

[amg] Only construct parallel helper if MPI was found

parent 13af9d39
No related branches found
No related tags found
1 merge request!1931[linearsolver] Only construct parallel helper if MPI was found
...@@ -82,8 +82,10 @@ public: ...@@ -82,8 +82,10 @@ public:
const typename LinearSolverTraits::DofMapper& dofMapper, const typename LinearSolverTraits::DofMapper& dofMapper,
const std::string& paramGroup = "") const std::string& paramGroup = "")
: LinearSolver(paramGroup) : LinearSolver(paramGroup)
#if HAVE_MPI
, 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)
#endif
{ {
reset(); reset();
} }
...@@ -224,9 +226,11 @@ private: ...@@ -224,9 +226,11 @@ private:
solver.apply(x, b, result_); solver.apply(x, b, result_);
} }
#if HAVE_MPI
std::shared_ptr<ParallelISTLHelper<LinearSolverTraits>> phelper_; std::shared_ptr<ParallelISTLHelper<LinearSolverTraits>> phelper_;
#endif
Dune::InverseOperatorResult result_; Dune::InverseOperatorResult result_;
bool isParallel_; bool isParallel_ = false;
bool firstCall_; bool firstCall_;
}; };
......
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