diff --git a/dune/solvers/solvers/loopsolver.cc b/dune/solvers/solvers/loopsolver.cc
index 146d1d222e92b8e97af1819020f7e5099526ea17..aba3bd413e7d1a7972c67ddf3553f01c835e7f5f 100644
--- a/dune/solvers/solvers/loopsolver.cc
+++ b/dune/solvers/solvers/loopsolver.cc
@@ -66,11 +66,11 @@ void LoopSolver<VectorType, BitVectorType>::solve()
         std::cout << std::endl;
     }
 
-    double error = std::numeric_limits<double>::max();
+    real_type error = std::numeric_limits<real_type>::max();
 
-    double normOfOldCorrection = 1;
-    double normOfOldError = 0;
-    double totalConvRate = 1;
+    real_type normOfOldCorrection = 1;
+    real_type normOfOldError = 0;
+    real_type totalConvRate = 1;
     this->maxTotalConvRate_ = 0;
     int convRateCounter = 0;
 
@@ -88,14 +88,14 @@ void LoopSolver<VectorType, BitVectorType>::solve()
             this->writeIterate(iterationStep_->getSol(), i);
 
         // Compute error
-        double oldNorm = this->errorNorm_->operator()(oldSolution);
+        real_type oldNorm = this->errorNorm_->operator()(oldSolution);
 
-        double normOfError=std::numeric_limits<double>::quiet_NaN();
+        real_type normOfError=std::numeric_limits<real_type>::quiet_NaN();
 
         // Please don't replace this call to 'diff' by computing the norm of the difference.
         // In some nonlinear DD applications the 'diff' method may be nonlinear.
-        double normOfCorrection = this->errorNorm_->diff(oldSolution,iterationStep_->getSol());
-        double convRate = normOfCorrection / normOfOldCorrection;
+        real_type normOfCorrection = this->errorNorm_->diff(oldSolution,iterationStep_->getSol());
+        real_type convRate = normOfCorrection / normOfOldCorrection;
         error = normOfCorrection;
         normOfOldCorrection = normOfCorrection;
 
@@ -115,7 +115,7 @@ void LoopSolver<VectorType, BitVectorType>::solve()
         if (!isinf(convRate) && !isnan(convRate) && i>0)
         {
             totalConvRate *= convRate;
-            this->maxTotalConvRate_ = std::max(this->maxTotalConvRate_, std::pow(totalConvRate, 1/((double)convRateCounter+1)));
+            this->maxTotalConvRate_ = std::max(this->maxTotalConvRate_, std::pow(totalConvRate, 1/((real_type)convRateCounter+1)));
             convRateCounter++;
         }
 
diff --git a/dune/solvers/solvers/loopsolver.hh b/dune/solvers/solvers/loopsolver.hh
index caede04932ee172a1f699b0acedd91b11b3e07bf..4e786546c88c9e437945b8339ca89c220e42a2c2 100644
--- a/dune/solvers/solvers/loopsolver.hh
+++ b/dune/solvers/solvers/loopsolver.hh
@@ -13,6 +13,11 @@
 template <class VectorType, class BitVectorType = Dune::BitSetVector<VectorType::block_type::dimension> >
 class LoopSolver : public IterativeSolver<VectorType, BitVectorType>
 {
+    typedef typename VectorType::field_type field_type;
+
+    // For complex-valued data
+    typedef typename Dune::FieldTraits<field_type>::real_type real_type;
+
 public:
 
     /** \brief Constructor taking all relevant data */