OGS
MFront.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "MFrontGeneric.h"
13#include "Variable.h"
14
15namespace MaterialLib
16{
17namespace Solids
18{
19namespace MFront
20{
21template <int DisplacementDim>
22class MFront : private MFrontGeneric<DisplacementDim,
23 boost::mp11::mp_list<Strain>,
24 boost::mp11::mp_list<Stress>,
25 boost::mp11::mp_list<Temperature>>,
26 public MechanicsBase<DisplacementDim>
27{
28 using Base = MFrontGeneric<DisplacementDim,
29 boost::mp11::mp_list<Strain>,
30 boost::mp11::mp_list<Stress>,
31 boost::mp11::mp_list<Temperature>>;
34
35public:
36 using Base::Base;
37
38 std::unique_ptr<
44
46 double const t,
49 material_state_variables) const override
50 {
51 Base::initializeInternalStateVariables(t, x, material_state_variables);
52 }
53
54 std::optional<std::tuple<KelvinVector,
55 std::unique_ptr<typename MechanicsBase<
56 DisplacementDim>::MaterialStateVariables>,
59 MaterialPropertyLib::VariableArray const& variable_array_prev,
60 MaterialPropertyLib::VariableArray const& variable_array,
61 double const t,
63 double const dt,
65 material_state_variables) const override
66 {
67 auto res = Base::integrateStress(variable_array_prev,
68 variable_array,
69 t,
70 x,
71 dt,
72 material_state_variables);
73
74 if (!res)
75 {
76 return std::nullopt;
77 }
78
79 auto& [stress_data, state, tangent_operator_data] = *res;
80 auto const view = this->createThermodynamicForcesView();
81
82 auto const C =
83 blocks_view_.block(stress, strain, tangent_operator_data);
84
85 return std::optional<
86 std::tuple<KelvinVector,
87 std::unique_ptr<typename MechanicsBase<
88 DisplacementDim>::MaterialStateVariables>,
89 KelvinMatrix>>{std::in_place,
90 view.block(stress, stress_data),
91 std::move(state), C};
92 }
93
94 std::vector<typename MechanicsBase<DisplacementDim>::InternalVariable>
95 getInternalVariables() const override
96 {
97 return Base ::getInternalVariables();
98 }
99
100 double getBulkModulus(double const t,
102 KelvinMatrix const* const C) const override
103 {
104 return Base::getBulkModulus(t, x, C);
105 }
106
108 double const t,
110 double const dt,
111 KelvinVector const& eps,
112 KelvinVector const& sigma,
114 material_state_variables) const override
115 {
117 t, x, dt, eps, sigma, material_state_variables);
118 }
119
120private:
122 DisplacementDim,
124 boost::mp11::mp_list<Stress>,
125 boost::mp11::mp_list<Temperature>>::type>
127};
128
129extern template class MFront<2>;
130extern template class MFront<3>;
131
132} // namespace MFront
133} // namespace Solids
134} // namespace MaterialLib
std::optional< std::tuple< OGSMFrontThermodynamicForcesData, std::unique_ptr< typename MechanicsBase< DisplacementDim >::MaterialStateVariables >, OGSMFrontTangentOperatorData > > integrateStress(MaterialPropertyLib::VariableArray const &variable_array_prev, MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x, double const dt, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables) const
double computeFreeEnergyDensity(double const, ParameterLib::SpatialPosition const &, double const, KelvinVector const &, KelvinVector const &, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &) const
void initializeInternalStateVariables(double const t, ParameterLib::SpatialPosition const &x, typename MechanicsBase< DisplacementDim >::MaterialStateVariables &material_state_variables) const
std::optional< std::tuple< KelvinVector, std::unique_ptr< typename MechanicsBase< DisplacementDim >::MaterialStateVariables >, KelvinMatrix > > integrateStress(MaterialPropertyLib::VariableArray const &variable_array_prev, MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x, double const dt, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables) const override
Definition MFront.h:58
std::vector< typename MechanicsBase< DisplacementDim >::InternalVariable > getInternalVariables() const override
Definition MFront.h:95
typename Base::KelvinMatrix KelvinMatrix
Definition MFront.h:33
void initializeInternalStateVariables(double const t, ParameterLib::SpatialPosition const &x, typename MechanicsBase< DisplacementDim >::MaterialStateVariables &material_state_variables) const override
Definition MFront.h:45
double getBulkModulus(double const t, ParameterLib::SpatialPosition const &x, KelvinMatrix const *const C) const override
Definition MFront.h:100
OGSMFrontTangentOperatorBlocksView< DisplacementDim, ForcesGradsCombinations< boost::mp11::mp_list< Strain >, boost::mp11::mp_list< Stress >, boost::mp11::mp_list< Temperature > >::type > blocks_view_
Definition MFront.h:126
double computeFreeEnergyDensity(double const t, ParameterLib::SpatialPosition const &x, double const dt, KelvinVector const &eps, KelvinVector const &sigma, typename MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables) const override
Definition MFront.h:107
std::unique_ptr< typename MechanicsBase< DisplacementDim >::MaterialStateVariables > createMaterialStateVariables() const override
Definition MFront.h:40
typename Base::KelvinVector KelvinVector
Definition MFront.h:32
static constexpr Strain strain
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:92
static constexpr Stress stress
Definition Variable.h:155