v0.16.0
Loading...
Searching...
No Matches
MatElastic.hpp
Go to the documentation of this file.
1/**
2 * @file MatElastic.hpp
3 * @brief
4 * @version 0.1
5 * @date 2026-04-02
6 *
7 * @copyright Copyright (c) 2026
8 *
9 */
10
11#ifndef MAT_ELASTIC_HPP
12#define MAT_ELASTIC_HPP
13
14namespace MatOps {
15
18 inline static bool useDeformationGradient =
19 false; // by default use common data pass gradient of displacement
20};
21
22struct ELASTICITY {
23 ELASTICITY() = delete;
24 // Behaviors
25 struct META {};
26 struct NEOHOOKEAN {};
30 struct TOPO_NEOHOOKEAN {};
31};
32
33/** \name Elasticity Operator Factory */
34/**@{*/
35template <int MODEL_TYPE> struct OpMaterialFactory<ELASTICITY, MODEL_TYPE> {
37
38 template <AssemblyType A, IntegrationType I, typename DomainEleOp>
39 static MoFEMErrorCode
41 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
42 std::string field_name,
43 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
45 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
46 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
47 A>::template LinearForm<I>;
48 using OpInternalForce = typename B::template OpGradTimesTensor<1, DIM, DIM>;
49 auto m_grad =
50 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
51 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
52 pip.push_back(
53 new OpCalculateVectorFieldGradient<DIM, DIM>(field_name, m_grad));
54 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr, true,
55 false, false));
56 pip.push_back(new OpInternalForce(field_name, m_P));
58 }
59
60 template <AssemblyType A, IntegrationType I, typename DomainEleOp>
61 static MoFEMErrorCode
63 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
64 std::string field_name,
65 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
67 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
68 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
69 A>::template BiLinearForm<I>;
70 using OpKPiola = typename B::template OpGradTensorGrad<1, DIM, DIM, -1>;
71 auto m_grad =
72 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
73 auto m_P_dF =
74 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P_dF");
75 pip.push_back(
76 new OpCalculateVectorFieldGradient<DIM, DIM>(field_name, m_grad));
77 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr,
78 false, true, false));
79 pip.push_back(new OpKPiola(field_name, field_name, m_P_dF));
81 }
82
83 static MoFEMErrorCode
85 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
86 std::string field_name,
87 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
89 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
90 auto m_grad =
91 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
92 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
93 pip.push_back(
94 new OpCalculateVectorFieldGradient<DIM, DIM>(field_name, m_grad));
95 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr,
96 false, false, true));
98 }
99
100 static MoFEMErrorCode opPostProcFactory(
101 MoFEM::Interface &m_field,
102 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
103 std::string field_name,
104 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
106 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
107 auto m_grad =
108 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
109 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
110 pip.push_back(
111 new OpCalculateVectorFieldGradient<DIM, DIM>(field_name, m_grad));
112 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr, true,
113 false, false));
115 }
116};
117/**@}*/
118
119/** \name Elasticity Material Models Creators */
120/**@{*/
121
122std::map<int, boost::shared_ptr<PhysicalEquations>> &
123getMetaElasticMap(boost::shared_ptr<PhysicalEquations> meta_ptr);
124
125template <>
126boost::shared_ptr<PhysicalEquations>
128 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
129
130template <>
131boost::shared_ptr<PhysicalEquations>
133 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
134
135template <>
136boost::shared_ptr<PhysicalEquations>
138 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
139
140template <>
141boost::shared_ptr<PhysicalEquations>
143 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
144
145template <>
146boost::shared_ptr<PhysicalEquations>
148 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
149
150template <>
151boost::shared_ptr<PhysicalEquations>
152createMatOpsPhysicalEquationsPtr<ELASTICITY::TOPO_NEOHOOKEAN,
154 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
155
156template <>
157boost::shared_ptr<PhysicalEquations>
159 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
160
161template <>
162boost::shared_ptr<PhysicalEquations>
163createMatOpsPhysicalEquationsPtr<ELASTICITY::MOONEYRIVLINWRIGGERSEQ63,
165 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
166
167template <>
168boost::shared_ptr<PhysicalEquations>
170 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
171
172template <>
173boost::shared_ptr<PhysicalEquations>
174createMatOpsPhysicalEquationsPtr<ELASTICITY::STVENANTKIRCHHOFF,
176 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
177
178template <>
179boost::shared_ptr<PhysicalEquations>
181 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
182
183template <>
184boost::shared_ptr<PhysicalEquations>
185createMatOpsPhysicalEquationsPtr<ELASTICITY::TOPO_NEOHOOKEAN,
187 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
188
196
197template <>
198boost::shared_ptr<PhysicalEquations>
200 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
201
202/**@}*/
203
204} // namespace MatOps
205
206#endif // MAT_ELASTIC_HPP
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
std::map< int, boost::shared_ptr< PhysicalEquations > > & getMetaElasticMap(boost::shared_ptr< PhysicalEquations > meta_ptr)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::MOONEYRIVLINWRIGGERSEQ63, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::NEOHOOKEAN, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
@ MODEL_3D
Definition MatOps.hpp:171
@ MODEL_2D_PLANE_STRAIN
Definition MatOps.hpp:172
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::META, MODEL_2D_PLANE_STRAIN >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::STVENANTKIRCHHOFF, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::TOPO_NEOHOOKEAN, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
VolumeLengthQualityType
@ BARRIER_AND_CHANGE_QUALITY_SCALED_BY_VOLUME
@ BARRIER_AND_QUALITY
@ LASTOP_VOLUMELENGTHQUALITYTYPE
@ BARRIER_AND_CHANGE_QUALITY
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::VOLUMELENGTHQUALITY, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::NEOHOOKEAN, MODEL_2D_PLANE_STRAIN >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< ELASTICITY::META, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesTensor< 1, FIELD_DIM, SPACE_DIM > OpGradTimesTensor
constexpr AssemblyType A
constexpr auto field_name
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, -1 > OpKPiola
[Only used for dynamics]
Definition seepage.cpp:63
static bool useDeformationGradient
static MoFEMErrorCode opUpdateFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr)
static MoFEMErrorCode opRhsFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr)
static MoFEMErrorCode opPostProcFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr)
static MoFEMErrorCode opLhsFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr)
Deprecated interface functions.