v0.16.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE > Struct Template Reference
Inheritance diagram for MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >:
[legend]
Collaboration diagram for MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >:
[legend]

Public Types

using A = MatPiolaResponseImpl< DIM >
 
using ResponsePtr = boost::shared_ptr< MatPiolaResponse >
 
- Public Types inherited from MatOps::PhysicalEquations
using HookFunction = std::function< MoFEMErrorCode(boost::shared_ptr< MatOpsData >, int, EntityHandle, int)>
 

Public Member Functions

 MatMetaPiolaResponse (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
 
MoFEMErrorCode getOptions (MoFEM::Interface *m_field_ptr=nullptr) override
 
MoFEMErrorCode setParams (FEMethod *fe_ptr, int gg) override
 
MoFEMErrorCode recordTape () override
 
MoFEMErrorCode evaluateVariable (int tag, EntityHandle entity, int gg) override
 
MoFEMErrorCode evaluateDerivatives (int tag, EntityHandle entity, int gg) override
 
MoFEMErrorCode updateState (int tag, EntityHandle entity, int gg) override
 
std::map< int, ResponsePtr > & getMetaPiolaResponseMap ()
 
- Public Member Functions inherited from MatOps::MatPiolaResponseImpl< DIM >
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
 
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
ForcesAndSourcesCore::UserDataOperator * createOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
- Public Member Functions inherited from MatOps::MatPiolaResponse
 PhysicalEquations ()=delete
 
 PhysicalEquations (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, boost::shared_ptr< std::map< int, Range > > tag_vs_range_ptr=nullptr)
 
- Public Member Functions inherited from MatOps::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag, boost::shared_ptr< std::map< int, Range > > tag_vs_range_ptr=nullptr)
 
virtual ~PhysicalEquations ()=default
 
virtual MoFEMErrorCode addBlockParameters (MoFEM::Interface &m_field, const std::string &block_name, int block_id, const Range &block_entities, const std::vector< double > &block_data)
 

Protected Attributes

std::map< int, ResponsePtr > metaPiolaResponses
 

Static Protected Attributes

static constexpr int modelType = MODEL_TYPE
 

Additional Inherited Members

- Public Attributes inherited from MatOps::PhysicalEquations
HookFunction hookEvaluateVariable = AdolCEvaluation::evaluateVariable
 
HookFunction hookEvaluateDerivatives = AdolCEvaluation::evaluateDerivatives
 
HookFunction hookUpdateState = AdolCEvaluation::evaluateVariable
 
int tAg
 
boost::shared_ptr< std::map< int, Range > > tagVsRangePtr
 
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
 
boost::shared_ptr< MatOpsData > matOpsDataPtr
 
- Static Public Attributes inherited from MatOps::MatPiolaResponse
static bool useDeformationGradient
 Otherwise the displacement gradient is supplied and I is added.
 

Detailed Description

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
struct MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >

Definition at line 15 of file MatMetaPiolaResponse.cpp.

Member Typedef Documentation

◆ A

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
using MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::A = MatPiolaResponseImpl<DIM>

Definition at line 16 of file MatMetaPiolaResponse.cpp.

◆ ResponsePtr

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
using MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::ResponsePtr = boost::shared_ptr<MatPiolaResponse>

Definition at line 17 of file MatMetaPiolaResponse.cpp.

Constructor & Destructor Documentation

◆ MatMetaPiolaResponse()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::MatMetaPiolaResponse ( boost::shared_ptr< MatOpsData >  mat_ops_data_ptr,
int  tag 
)
inline

Definition at line 19 of file MatMetaPiolaResponse.cpp.

20 : A(mat_ops_data_ptr, tag) {
21
22 // Neohookean material is default
23 const int default_tag = MatOpsTagsRegistry::setTagName("MetaPiolaResponse");
24 metaPiolaResponses.emplace(
25 default_tag,
26 boost::static_pointer_cast<MatPiolaResponse>(
27 createMatOpsPhysicalEquationsPtr<ELASTICITY::NEOHOOKEAN, modelType>(
28 this->matOpsDataPtr, default_tag)));
29
30 // Mooney Rivlinw has policonvex coffactor term which only make sense in 3d
31 if constexpr (DIM == 3) {
32 const int mooney_tag =
33 MatOpsTagsRegistry::setTagName("MooneyRivlinWriggersEq63");
34 metaPiolaResponses.emplace(
35 mooney_tag, boost::static_pointer_cast<MatPiolaResponse>(
37 ELASTICITY::MOONEYRIVLINWRIGGERSEQ63, MODEL_3D>(
38 this->matOpsDataPtr, mooney_tag)));
39 }
40
41 // Kirchoff Stvent model
42 const int stvenant_tag =
43 MatOpsTagsRegistry::setTagName("StVenantKirchhoff");
44 metaPiolaResponses.emplace(
45 stvenant_tag,
46 boost::static_pointer_cast<MatPiolaResponse>(
47 createMatOpsPhysicalEquationsPtr<ELASTICITY::STVENANTKIRCHHOFF,
49 stvenant_tag)));
50
51 }
Tag tag
@ MODEL_3D
Definition MatOps.hpp:234
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
MatPiolaResponseImpl< DIM > A
std::map< int, ResponsePtr > metaPiolaResponses
static int setTagName(std::string name, int tag=-1)
Definition MatOps.cpp:29
boost::shared_ptr< MatOpsData > matOpsDataPtr
Definition MatOps.hpp:201

Member Function Documentation

◆ evaluateDerivatives()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::evaluateDerivatives ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 138 of file MatMetaPiolaResponse.cpp.

139 {
140 return metaPiolaResponses.at(tag)->evaluateDerivatives(tag, entity, gg);
141 }

◆ evaluateVariable()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::evaluateVariable ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 133 of file MatMetaPiolaResponse.cpp.

134 {
135 return metaPiolaResponses.at(tag)->evaluateVariable(tag, entity, gg);
136 }

◆ getMetaPiolaResponseMap()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
std::map< int, ResponsePtr > & MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::getMetaPiolaResponseMap ( )
inline

Definition at line 147 of file MatMetaPiolaResponse.cpp.

147 {
148 return metaPiolaResponses;
149 }

◆ getOptions()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::getOptions ( MoFEM::Interface *  m_field_ptr = nullptr)
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 53 of file MatMetaPiolaResponse.cpp.

53 {
55
56 // An unused UMAT still binds state tags and blocks elastic reference transfer.
57 char umat_library[PETSC_MAX_PATH_LEN] = "";
58 CHKERR PetscOptionsGetString(PETSC_NULLPTR, PETSC_NULLPTR, "-umat_library",
59 umat_library, sizeof(umat_library),
60 PETSC_NULLPTR);
61 if (umat_library[0] ||
62 (m_field_ptr &&
63 !m_field_ptr->getInterface<MeshsetsManager>()
64 ->getCubitMeshsetPtr(std::regex("MAT_UMAT(.*)"))
65 .empty())) {
66 const int umat_tag = MatOpsTagsRegistry::setTagName("Umat");
67 metaPiolaResponses.insert(
68 {umat_tag, boost::static_pointer_cast<MatPiolaResponse>(
69 createMatOpsPhysicalEquationsPtr<UMAT, modelType>(
70 this->matOpsDataPtr, umat_tag))});
71 }
72
73 for (auto &m : metaPiolaResponses) {
74 CHKERR m.second->getOptions(m_field_ptr);
75 }
76
77 // tagVsRangePtr is used to store the ranges of entities for each tag. It is
78 // initialized here based on the ranges provided by each response in
79 // metaPiolaResponses. This allows the MatMetaPiolaResponse to manage
80 // multiple responses and their associated entity ranges effectively.
81 A::tagVsRangePtr = boost::make_shared<std::map<int, Range>>();
82 for (const auto &m : metaPiolaResponses) {
83 A::tagVsRangePtr->insert(
84 {m.first, Range()}); // Initialize with empty range
85 for (auto &rp : m.second->paramVecByRange) {
86 A::tagVsRangePtr->at(m.first).merge(
87 rp.first); // Merge ranges for the same tag
88 }
89 }
91 }
#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()
#define CHKERR
Inline error check.
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
FTensor::Index< 'm', 3 > m
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
Definition MatOps.hpp:199
boost::shared_ptr< std::map< int, Range > > tagVsRangePtr
Definition MatOps.hpp:198
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ recordTape()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::recordTape ( )
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 125 of file MatMetaPiolaResponse.cpp.

125 {
127 for (auto &m : metaPiolaResponses) {
128 CHKERR m.second->recordTape();
129 }
131 }

◆ setParams()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::setParams ( FEMethod *  fe_ptr,
int  gg 
)
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 93 of file MatMetaPiolaResponse.cpp.

93 {
95 const auto ent = fe_ptr->getFEEntityHandle();
96
97 bool has_ranges = false;
98 if (A::tagVsRangePtr) {
99 for (const auto &tag_range : *A::tagVsRangePtr) {
100 has_ranges = has_ranges || !tag_range.second.empty();
101 }
102 }
103
104 if (!has_ranges) {
105 for (auto &m : metaPiolaResponses) {
106 CHKERR m.second->setParams(fe_ptr, gg);
107 }
109 }
110
111 for (auto &m : metaPiolaResponses) {
112 if (A::tagVsRangePtr->at(m.first).find(ent) !=
113 A::tagVsRangePtr->at(m.first).end()) {
114 CHKERR m.second->setParams(fe_ptr, gg);
116 }
117 }
118
119 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
120 "Meta Piola-response parameters not found for entity %lu",
121 static_cast<unsigned long>(ent));
123 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31

◆ updateState()

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
MoFEMErrorCode MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::updateState ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 143 of file MatMetaPiolaResponse.cpp.

143 {
144 return metaPiolaResponses.at(tag)->updateState(tag, entity, gg);
145 }

Member Data Documentation

◆ metaPiolaResponses

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
std::map<int, ResponsePtr> MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::metaPiolaResponses
protected

Definition at line 154 of file MatMetaPiolaResponse.cpp.

◆ modelType

template<int DIM, int MODEL_TYPE = (DIM == 3) ? MatOps::MODEL_3D : MatOps::MODEL_2D_PLANE_STRAIN>
constexpr int MatOps::MatMetaPiolaResponse< DIM, MODEL_TYPE >::modelType = MODEL_TYPE
inlinestaticconstexprprotected

Definition at line 152 of file MatMetaPiolaResponse.cpp.


The documentation for this struct was generated from the following file: