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
14#include <MatUmat.hpp>
15
16namespace MatOps {
17
20 inline static bool useDeformationGradient =
21 false; // by default use common data pass gradient of displacement
22};
23
24struct ELASTICITY {
25 ELASTICITY() = delete;
26 // Behaviors
27 struct META {};
28 struct NEOHOOKEAN {};
32};
33
34/** \name Elasticity Operator Factory */
35/**@{*/
36template <int MODEL_TYPE> struct OpMaterialFactory<ELASTICITY, MODEL_TYPE> {
38
39 template <AssemblyType A, IntegrationType I, typename DomainEleOp>
40 static MoFEMErrorCode
42 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
43 std::string field_name,
44 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
46 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
47 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
48 A>::template LinearForm<I>;
49 using OpInternalForce = typename B::template OpGradTimesTensor<1, DIM, DIM>;
50 auto m_grad =
51 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
52 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
53 pip.push_back(
55 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr, true,
56 false, false));
57 pip.push_back(new OpInternalForce(field_name, m_P));
59 }
60
61 template <AssemblyType A, IntegrationType I, typename DomainEleOp>
62 static MoFEMErrorCode
64 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
65 std::string field_name,
66 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
68 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
69 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
70 A>::template BiLinearForm<I>;
71 using OpKPiola = typename B::template OpGradTensorGrad<1, DIM, DIM, -1>;
72 auto m_grad =
73 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
74 auto m_P_dF =
75 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P_dF");
76 pip.push_back(
78 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr,
79 false, true, false));
80 pip.push_back(new OpKPiola(field_name, field_name, m_P_dF));
82 }
83
84 static MoFEMErrorCode
86 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
87 std::string field_name,
88 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
90 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
91 auto m_grad =
92 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
93 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
94 pip.push_back(
96 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr,
97 false, false, true));
99 }
100
102 MoFEM::Interface &m_field,
103 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
104 std::string field_name,
105 boost::shared_ptr<PhysicalEquations> physical_equations_ptr) {
107 constexpr int DIM = (MODEL_TYPE == MODEL_3D) ? 3 : 2;
108 auto m_grad =
109 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("grad");
110 auto m_P = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr("P");
111 pip.push_back(
113 pip.push_back(physical_equations_ptr->createOp(physical_equations_ptr, true,
114 false, false));
116 }
117};
118/**@}*/
119
120/** \name Elasticity Material Models Creators */
121/**@{*/
122
123std::map<int, boost::shared_ptr<PhysicalEquations>> &
124getMetaElasticMap(boost::shared_ptr<PhysicalEquations> meta_ptr);
125
126template <>
127boost::shared_ptr<PhysicalEquations>
129 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
130
131template <>
132boost::shared_ptr<PhysicalEquations>
134 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
135
136template <>
137boost::shared_ptr<PhysicalEquations>
139 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
140
141template <>
142boost::shared_ptr<PhysicalEquations>
144 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
145
146template <>
147boost::shared_ptr<PhysicalEquations>
149 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
150
151template <>
152boost::shared_ptr<PhysicalEquations>
153createMatOpsPhysicalEquationsPtr<ELASTICITY::MOONEYRIVLINWRIGGERSEQ63,
155 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
156
157template <>
158boost::shared_ptr<PhysicalEquations>
160 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
161
162template <>
163boost::shared_ptr<PhysicalEquations>
164createMatOpsPhysicalEquationsPtr<ELASTICITY::STVENANTKIRCHHOFF,
166 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
167
175
176template <>
177boost::shared_ptr<PhysicalEquations>
179 boost::shared_ptr<MatOpsData> mat_ops_data_ptr, int tag);
180
181/**@}*/
182
183} // namespace MatOps
184
185#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:181
@ MODEL_2D_PLANE_STRAIN
Definition MatOps.hpp:182
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)
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)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
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.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.