From 1dc27da5e1f95e35ae26f180bd60dadc0be69209 Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Thu, 4 Mar 2021 09:31:20 +0100
Subject: [PATCH] [THM] Removed the double declared VariableArray

---
 .../ThermoHydroMechanicsFEM-impl.h                  | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h
index 8158264e396..2c359c228af 100644
--- a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h
+++ b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM-impl.h
@@ -186,8 +186,6 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
     MaterialLib::Solids::MechanicsBase<DisplacementDim> const& solid_material =
         *_process_data.solid_materials[0];
 
-    MPL::VariableArray variables;
-
     ParameterLib::SpatialPosition x_position;
     x_position.setElementID(_element.getID());
 
@@ -348,13 +346,12 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
         // displacement equation, displacement part
         //
         eps_m.noalias() = eps - thermal_strain;
-        variables[static_cast<int>(
-                      MaterialPropertyLib::Variable::mechanical_strain)]
+        vars[static_cast<int>(MaterialPropertyLib::Variable::mechanical_strain)]
             .emplace<MathLib::KelvinVector::KelvinVectorType<DisplacementDim>>(
                 eps_m);
 
         auto C = _ip_data[ip].updateConstitutiveRelationThermal(
-            variables, t, x_position, dt, u,
+            vars, t, x_position, dt, u,
             _process_data.reference_temperature(t, x_position)[0]);
 
         local_Jac
@@ -683,7 +680,6 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
     auto p = Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
         pressure_size> const>(local_x.data() + pressure_index, pressure_size);
 
-    MPL::VariableArray variables;
     ParameterLib::SpatialPosition x_position;
     x_position.setElementID(_element.getID());
     auto const& medium = _process_data.media_map->getMedium(_element.getID());
@@ -739,13 +735,12 @@ void ThermoHydroMechanicsLocalAssembler<ShapeFunctionDisplacement,
         auto& eps_m = _ip_data[ip].eps_m;
         eps_m.noalias() = eps - thermal_strain;
 
-        variables[static_cast<int>(
-                      MaterialPropertyLib::Variable::mechanical_strain)]
+        vars[static_cast<int>(MaterialPropertyLib::Variable::mechanical_strain)]
             .emplace<MathLib::KelvinVector::KelvinVectorType<DisplacementDim>>(
                 eps_m);
 
         _ip_data[ip].updateConstitutiveRelationThermal(
-            variables, t, x_position, dt, u,
+            vars, t, x_position, dt, u,
             _process_data.reference_temperature(t, x_position)[0]);
     }
 }
-- 
GitLab