diff --git a/dumux/linear/amgbackend.hh b/dumux/linear/amgbackend.hh index 840933a97afea369ecc0b55a7bbe74cf0ba5642e..92435484814c0b2a02c25f3bebb1d78f451ede6b 100644 --- a/dumux/linear/amgbackend.hh +++ b/dumux/linear/amgbackend.hh @@ -82,8 +82,10 @@ public: const typename LinearSolverTraits::DofMapper& dofMapper, const std::string& paramGroup = "") : LinearSolver(paramGroup) - , phelper_(std::make_shared>(gridView, dofMapper)) +#if HAVE_MPI + , phelper_(std::make_unique>(gridView, dofMapper)) , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1) +#endif { reset(); } @@ -224,9 +226,11 @@ private: solver.apply(x, b, result_); } - std::shared_ptr> phelper_; +#if HAVE_MPI + std::unique_ptr> phelper_; +#endif Dune::InverseOperatorResult result_; - bool isParallel_; + bool isParallel_ = false; bool firstCall_; }; diff --git a/dumux/linear/istlsolverfactorybackend.hh b/dumux/linear/istlsolverfactorybackend.hh index fa96f2e425911fd2dda0f43b905309f459319c43..71e330eb9c9295830fdd06debf558ef43649c5d0 100644 --- a/dumux/linear/istlsolverfactorybackend.hh +++ b/dumux/linear/istlsolverfactorybackend.hh @@ -85,8 +85,10 @@ public: const typename LinearSolverTraits::DofMapper& dofMapper, const std::string& paramGroup = "") : paramGroup_(paramGroup) +#if HAVE_MPI , parallelHelper_(std::make_unique>(gridView, dofMapper)) , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1) +#endif { reset(); } @@ -227,8 +229,10 @@ private: } const std::string paramGroup_; +#if HAVE_MPI std::unique_ptr> parallelHelper_; - bool isParallel_; +#endif + bool isParallel_ = false; bool firstCall_; Dune::InverseOperatorResult result_; diff --git a/dumux/linear/linearsolvertraits.hh b/dumux/linear/linearsolvertraits.hh index dcca6e0a7565ffda191065495f3ccd56dde3529e..154071021c4551d148cc1c349c73ee30a5ee5f8d 100644 --- a/dumux/linear/linearsolvertraits.hh +++ b/dumux/linear/linearsolvertraits.hh @@ -125,11 +125,13 @@ struct LinearSolverTraitsBase template using Sequential = SequentialSolverTraits; +#if HAVE_MPI template using ParallelOverlapping = OverlappingSolverTraits; template using ParallelNonoverlapping = NonoverlappingSolverTraits; +#endif }; //! Box: use overlapping or non-overlapping model depending on the grid