From e4bd3f1fc7c3f058923450f69ed8fc2a68b79b88 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Thu, 20 Dec 2018 15:01:19 +0100
Subject: [PATCH] [MatL] Ehlers; Move definitions into cpp.

When the SolidEhlers ctor is not used it was not generated in the library.
---
 MaterialLib/SolidModels/Ehlers.cpp | 34 ++++++++++++++++++++++++++++++
 MaterialLib/SolidModels/Ehlers.h   | 23 +++-----------------
 2 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/MaterialLib/SolidModels/Ehlers.cpp b/MaterialLib/SolidModels/Ehlers.cpp
index 2cda03b5f9d..42c453e6162 100644
--- a/MaterialLib/SolidModels/Ehlers.cpp
+++ b/MaterialLib/SolidModels/Ehlers.cpp
@@ -468,6 +468,40 @@ splitSolutionVector(ResidualVector const& solution)
         solution[size * 2 + 2]);
 }
 
+template <int DisplacementDim>
+SolidEhlers<DisplacementDim>::SolidEhlers(
+    NumLib::NewtonRaphsonSolverParameters nonlinear_solver_parameters,
+    MaterialPropertiesParameters material_properties,
+    std::unique_ptr<DamagePropertiesParameters>&& damage_properties,
+    TangentType tangent_type)
+    : _nonlinear_solver_parameters(std::move(nonlinear_solver_parameters)),
+      _mp(std::move(material_properties)),
+      _damage_properties(std::move(damage_properties)),
+      _tangent_type(tangent_type)
+{
+}
+
+template <int DisplacementDim>
+double SolidEhlers<DisplacementDim>::computeFreeEnergyDensity(
+    double const /*t*/,
+    ProcessLib::SpatialPosition const& /*x*/,
+    double const /*dt*/,
+    KelvinVector const& eps,
+    KelvinVector const& sigma,
+    typename MechanicsBase<DisplacementDim>::MaterialStateVariables const&
+        material_state_variables) const
+{
+    assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
+               &material_state_variables) != nullptr);
+
+    auto const& eps_p = static_cast<StateVariables<DisplacementDim> const&>(
+                            material_state_variables)
+                            .eps_p;
+    using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>;
+    auto const& identity2 = Invariants::identity2;
+    return (eps - eps_p.D - eps_p.V / 3 * identity2).dot(sigma) / 2;
+}
+
 template <int DisplacementDim>
 boost::optional<std::tuple<typename SolidEhlers<DisplacementDim>::KelvinVector,
                            std::unique_ptr<typename MechanicsBase<
diff --git a/MaterialLib/SolidModels/Ehlers.h b/MaterialLib/SolidModels/Ehlers.h
index 22575ca2ef3..5121c31c99e 100644
--- a/MaterialLib/SolidModels/Ehlers.h
+++ b/MaterialLib/SolidModels/Ehlers.h
@@ -297,17 +297,11 @@ public:
         MathLib::KelvinVector::KelvinMatrixType<DisplacementDim>;
 
 public:
-    explicit SolidEhlers(
+    SolidEhlers(
         NumLib::NewtonRaphsonSolverParameters nonlinear_solver_parameters,
         MaterialPropertiesParameters material_properties,
         std::unique_ptr<DamagePropertiesParameters>&& damage_properties,
-        TangentType tangent_type)
-        : _nonlinear_solver_parameters(std::move(nonlinear_solver_parameters)),
-          _mp(std::move(material_properties)),
-          _damage_properties(std::move(damage_properties)),
-          _tangent_type(tangent_type)
-    {
-    }
+        TangentType tangent_type);
 
     double computeFreeEnergyDensity(
         double const /*t*/,
@@ -316,18 +310,7 @@ public:
         KelvinVector const& eps,
         KelvinVector const& sigma,
         typename MechanicsBase<DisplacementDim>::MaterialStateVariables const&
-            material_state_variables) const override
-    {
-        assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
-                   &material_state_variables) != nullptr);
-
-        auto const& eps_p = static_cast<StateVariables<DisplacementDim> const&>(
-                                material_state_variables)
-                                .eps_p;
-        using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>;
-        auto const& identity2 = Invariants::identity2;
-        return (eps - eps_p.D - eps_p.V / 3 * identity2).dot(sigma) / 2;
-    }
+            material_state_variables) const override;
 
     boost::optional<std::tuple<KelvinVector,
                                std::unique_ptr<typename MechanicsBase<
-- 
GitLab