From d8b42a02ec04281832f095c92f182e8b7d4d9aa9 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Tue, 31 Mar 2020 15:05:09 +0200
Subject: [PATCH] [amg] Only construct parallel helper if MPI was found

---
 dumux/linear/amgbackend.hh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dumux/linear/amgbackend.hh b/dumux/linear/amgbackend.hh
index 840933a97a..7c49d40d6b 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)
+#if HAVE_MPI
     , phelper_(std::make_shared<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper))
     , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1)
+#endif
     {
         reset();
     }
@@ -224,9 +226,11 @@ private:
         solver.apply(x, b, result_);
     }
 
+#if HAVE_MPI
     std::shared_ptr<ParallelISTLHelper<LinearSolverTraits>> phelper_;
+#endif
     Dune::InverseOperatorResult result_;
-    bool isParallel_;
+    bool isParallel_ = false;
     bool firstCall_;
 };
 
-- 
GitLab