From 947309a4783f772c23975b673d842dd741ac234d Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Wed, 12 Oct 2022 16:41:30 +0200
Subject: [PATCH] [tabulatedcomponent] Capture by value in lambda functions

---
 dumux/material/components/tabulatedcomponent.hh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dumux/material/components/tabulatedcomponent.hh b/dumux/material/components/tabulatedcomponent.hh
index 5728d403e6..7f211746e5 100644
--- a/dumux/material/components/tabulatedcomponent.hh
+++ b/dumux/material/components/tabulatedcomponent.hh
@@ -825,7 +825,7 @@ private:
     static void initVaporPressure_()
     {
         // fill the temperature-pressure arrays
-        Dumux::parallelFor(nTemp_, [&](std::size_t iT)
+        Dumux::parallelFor(nTemp_, [](std::size_t iT)
         {
             Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
             vaporPressure_[iT] = RawComponent::vaporPressure(temperature);
@@ -853,7 +853,7 @@ private:
     template<class PropFunc, class MinPFunc, class MaxPFunc>
     static void initTPArray_(const PropFunc& f, const MinPFunc& minP, const MaxPFunc& maxP, std::vector<typename RawComponent::Scalar>& values)
     {
-        Dumux::parallelFor(nTemp_, [&](std::size_t iT)
+        Dumux::parallelFor(nTemp_, [=,&values](std::size_t iT)
         {
             Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
 
@@ -889,7 +889,7 @@ private:
                                     std::vector<typename RawComponent::Scalar>& rhoMin,
                                     std::vector<typename RawComponent::Scalar>& rhoMax)
     {
-        Dumux::parallelFor(nTemp_, [&](std::size_t iT)
+        Dumux::parallelFor(nTemp_, [=,&rhoMin,&rhoMax](std::size_t iT)
         {
             Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
 
@@ -917,7 +917,7 @@ private:
                                    const std::vector<typename RawComponent::Scalar>& rhoMin,
                                    const std::vector<typename RawComponent::Scalar>& rhoMax)
     {
-        Dumux::parallelFor(nTemp_, [&](std::size_t iT)
+        Dumux::parallelFor(nTemp_, [=,&pressure,&rhoMin,&rhoMax](std::size_t iT)
         {
             Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
 
-- 
GitLab