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

Public Types

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

Public Member Functions

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, boost::shared_ptr< PhysicalEquations > > & getMetaElasticMap ()
 
- Public Member Functions inherited from MatOps::MatElasticImpl< DIM >
ForcesAndSourcesCore::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update) override
 
ForcesAndSourcesCore::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
ForcesAndSourcesCore::UserDataOperatorcreateOp (boost::shared_ptr< PhysicalEquations > physical_ptr, bool eval_stress, bool eval_tangent, bool update)
 
- Public Member Functions inherited from MatOps::MatElastic
 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, boost::shared_ptr< PhysicalEquations > > metaElasticAtPts
 

Static Protected Attributes

static constexpr int modelType
 

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< MatOpsDatamatOpsDataPtr
 
- Static Public Attributes inherited from MatOps::MatElastic
static bool useDeformationGradient
 

Detailed Description

template<int DIM>
struct MatOps::MatMetaElastic< DIM >

Definition at line 13 of file MatMetaElastic.cpp.

Member Typedef Documentation

◆ A

template<int DIM>
using MatOps::MatMetaElastic< DIM >::A = MatElasticImpl<DIM>

Definition at line 16 of file MatMetaElastic.cpp.

Member Function Documentation

◆ evaluateDerivatives()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::evaluateDerivatives ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 94 of file MatMetaElastic.cpp.

95 {
96 return metaElasticAtPts.at(tag)->evaluateDerivatives(tag, entity, gg);
97 }
std::map< int, boost::shared_ptr< PhysicalEquations > > metaElasticAtPts

◆ evaluateVariable()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::evaluateVariable ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 89 of file MatMetaElastic.cpp.

90 {
91 return metaElasticAtPts.at(tag)->evaluateVariable(tag, entity, gg);
92 }

◆ getMetaElasticMap()

template<int DIM>
std::map< int, boost::shared_ptr< PhysicalEquations > > & MatOps::MatMetaElastic< DIM >::getMetaElasticMap ( )
inline

Definition at line 103 of file MatMetaElastic.cpp.

103 {
104 return metaElasticAtPts;
105 }

◆ getOptions()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::getOptions ( MoFEM::Interface m_field_ptr = nullptr)
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 18 of file MatMetaElastic.cpp.

18 {
20
21 char umat_library[PETSC_MAX_PATH_LEN] = "./umat.so";
22 CHKERR PetscOptionsGetString(PETSC_NULLPTR, PETSC_NULLPTR,
23 "-umat_library", umat_library,
24 sizeof(umat_library), PETSC_NULLPTR);
25
26 if (std::filesystem::exists(std::filesystem::path(umat_library))) {
27 metaElasticAtPts.insert(
29 createMatOpsPhysicalEquationsPtr<UMAT, modelType>(
30 this->matOpsDataPtr,
32 }
33
34 for (auto &m : metaElasticAtPts) {
35 CHKERR m.second->getOptions(m_field_ptr);
36 }
37 A::tagVsRangePtr = boost::make_shared<std::map<int, Range>>();
38 for (const auto &m : metaElasticAtPts) {
39 A::tagVsRangePtr->insert(
40 {m.first, Range()}); // Initialize with empty range
41 for (auto &rp : m.second->paramVecByRange) {
42 A::tagVsRangePtr->at(m.first).merge(
43 rp.first); // Merge ranges for the same tag
44 }
45 }
47 }
#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
static int setTagName(std::string name, int tag=-1)
Definition MatOps.cpp:30
std::vector< std::pair< Range, std::vector< double > > > paramVecByRange
Definition MatOps.hpp:162
boost::shared_ptr< std::map< int, Range > > tagVsRangePtr
Definition MatOps.hpp:161
boost::shared_ptr< MatOpsData > matOpsDataPtr
Definition MatOps.hpp:164

◆ recordTape()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::recordTape ( )
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 81 of file MatMetaElastic.cpp.

81 {
83 for (auto &m : metaElasticAtPts) {
84 CHKERR m.second->recordTape();
85 }
87 }

◆ setParams()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::setParams ( FEMethod fe_ptr,
int  gg 
)
inlineoverridevirtual

Implements MatOps::PhysicalEquations.

Definition at line 49 of file MatMetaElastic.cpp.

49 {
51 const auto ent = fe_ptr->getFEEntityHandle();
52
53 bool has_ranges = false;
54 if (A::tagVsRangePtr) {
55 for (const auto &tag_range : *A::tagVsRangePtr) {
56 has_ranges = has_ranges || !tag_range.second.empty();
57 }
58 }
59
60 if (!has_ranges) {
61 for (auto &m : metaElasticAtPts) {
62 CHKERR m.second->setParams(fe_ptr, gg);
63 }
65 }
66
67 for (auto &m : metaElasticAtPts) {
68 if (A::tagVsRangePtr->at(m.first).find(ent) !=
69 A::tagVsRangePtr->at(m.first).end()) {
70 CHKERR m.second->setParams(fe_ptr, gg);
72 }
73 }
74
75 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
76 "Meta elastic material parameters not found for entity %lu",
77 static_cast<unsigned long>(ent));
79 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
MatElasticImpl< DIM > A

◆ updateState()

template<int DIM>
MoFEMErrorCode MatOps::MatMetaElastic< DIM >::updateState ( int  tag,
EntityHandle  entity,
int  gg 
)
inlineoverridevirtual

Reimplemented from MatOps::PhysicalEquations.

Definition at line 99 of file MatMetaElastic.cpp.

99 {
100 return metaElasticAtPts.at(tag)->updateState(tag, entity, gg);
101 }

Member Data Documentation

◆ metaElasticAtPts

template<int DIM>
std::map<int, boost::shared_ptr<PhysicalEquations> > MatOps::MatMetaElastic< DIM >::metaElasticAtPts
protected

Definition at line 111 of file MatMetaElastic.cpp.

111 {
112
113 {
114
115 // First tag is always MetaElastic tag
117 createMatOpsPhysicalEquationsPtr<ELASTICITY::NEOHOOKEAN, modelType>(
118 this->matOpsDataPtr,
120
121 },
122
123 {
124
125 MatOps::MatOpsTagsRegistry::setTagName("MooneyRivlinWriggersEq63"),
126 createMatOpsPhysicalEquationsPtr<ELASTICITY::MOONEYRIVLINWRIGGERSEQ63,
127 modelType>(
129 "MooneyRivlinWriggersEq63"))
130
131 },
132
133 {
134
135 MatOps::MatOpsTagsRegistry::setTagName("StVenantKirchhoff"),
136 createMatOpsPhysicalEquationsPtr<ELASTICITY::STVENANTKIRCHHOFF,
137 modelType>(
138 this->matOpsDataPtr,
139 MatOps::MatOpsTagsRegistry::setTagName("StVenantKirchhoff"))
140
141 },
142
143 };
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
static constexpr int modelType

◆ modelType

template<int DIM>
constexpr int MatOps::MatMetaElastic< DIM >::modelType
inlinestaticconstexprprotected
Initial value:

Definition at line 108 of file MatMetaElastic.cpp.


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