Skip to content
Snippets Groups Projects
Commit 1c03227d authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #1854 from endJunction/RestructureSolidMaterials

Restructure solid materials
parents b91c595d ff8da7c2
No related branches found
No related tags found
No related merge requests found
...@@ -190,9 +190,8 @@ std::unique_ptr<SolidEhlers<DisplacementDim>> createEhlers( ...@@ -190,9 +190,8 @@ std::unique_ptr<SolidEhlers<DisplacementDim>> createEhlers(
auto const nonlinear_solver_parameters = auto const nonlinear_solver_parameters =
createNewtonRaphsonSolverParameters(nonlinear_solver_config); createNewtonRaphsonSolverParameters(nonlinear_solver_config);
return std::unique_ptr<SolidEhlers<DisplacementDim>>{ return std::make_unique<SolidEhlers<DisplacementDim>>(
new SolidEhlers<DisplacementDim>{nonlinear_solver_parameters, mp, nonlinear_solver_parameters, mp, std::move(ehlers_damage_properties));
std::move(ehlers_damage_properties)}};
} }
} // namespace Ehlers } // namespace Ehlers
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include "Ehlers.h" #include "Ehlers.h"
#include "Ehlers-impl.h"
namespace MaterialLib namespace MaterialLib
{ {
......
...@@ -241,7 +241,8 @@ private: ...@@ -241,7 +241,8 @@ private:
std::unique_ptr<DamagePropertiesParameters> _damage_properties; std::unique_ptr<DamagePropertiesParameters> _damage_properties;
}; };
extern template class SolidEhlers<2>;
extern template class SolidEhlers<3>;
} // namespace Ehlers } // namespace Ehlers
} // namespace Solids } // namespace Solids
} // namespace MaterialLib } // namespace MaterialLib
#include "Ehlers-impl.h"
/**
* \copyright
* Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include "LinearElasticIsotropic.h"
namespace MaterialLib
{
namespace Solids
{
template <int DisplacementDim>
boost::optional<
std::tuple<typename LinearElasticIsotropic<DisplacementDim>::KelvinVector,
std::unique_ptr<typename MechanicsBase<
DisplacementDim>::MaterialStateVariables>,
typename LinearElasticIsotropic<DisplacementDim>::KelvinMatrix>>
LinearElasticIsotropic<DisplacementDim>::integrateStress(
double const t,
ProcessLib::SpatialPosition const& x,
double const /*dt*/,
KelvinVector const& eps_prev,
KelvinVector const& eps,
KelvinVector const& sigma_prev,
typename MechanicsBase<DisplacementDim>::MaterialStateVariables const&
material_state_variables)
{
KelvinMatrix C = KelvinMatrix::Zero();
C.template topLeftCorner<3, 3>().setConstant(_mp.lambda(t, x));
C.noalias() += 2 * _mp.mu(t, x) * KelvinMatrix::Identity();
KelvinVector sigma = sigma_prev + C * (eps - eps_prev);
return {std::make_tuple(
sigma,
std::unique_ptr<
typename MechanicsBase<DisplacementDim>::MaterialStateVariables>{
new MaterialStateVariables{
static_cast<MaterialStateVariables const&>(
material_state_variables)}},
C)};
}
extern template class LinearElasticIsotropic<2>;
extern template class LinearElasticIsotropic<3>;
} // namespace Solids
} // namespace MaterialLib
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include "LinearElasticIsotropic.h" #include "LinearElasticIsotropic.h"
#include "LinearElasticIsotropic-impl.h"
namespace MaterialLib namespace MaterialLib
{ {
......
...@@ -99,24 +99,7 @@ public: ...@@ -99,24 +99,7 @@ public:
KelvinVector const& eps, KelvinVector const& eps,
KelvinVector const& sigma_prev, KelvinVector const& sigma_prev,
typename MechanicsBase<DisplacementDim>::MaterialStateVariables const& typename MechanicsBase<DisplacementDim>::MaterialStateVariables const&
material_state_variables) override material_state_variables) override;
{
KelvinMatrix C = KelvinMatrix::Zero();
C.template topLeftCorner<3, 3>().setConstant(_mp.lambda(t, x));
C.noalias() += 2 * _mp.mu(t, x) * KelvinMatrix::Identity();
KelvinVector sigma = sigma_prev + C * (eps - eps_prev);
return {
std::make_tuple(sigma,
std::unique_ptr<typename MechanicsBase<
DisplacementDim>::MaterialStateVariables>{
new MaterialStateVariables{
static_cast<MaterialStateVariables const&>(
material_state_variables)}},
C)};
}
private: private:
MaterialProperties _mp; MaterialProperties _mp;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include "Lubby2.h" #include "Lubby2.h"
#include "Lubby2-impl.h"
namespace MaterialLib namespace MaterialLib
{ {
......
...@@ -233,5 +233,3 @@ extern template class Lubby2<3>; ...@@ -233,5 +233,3 @@ extern template class Lubby2<3>;
} // namespace Lubby2 } // namespace Lubby2
} // namespace Solids } // namespace Solids
} // namespace MaterialLib } // namespace MaterialLib
#include "Lubby2-impl.h"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment