21 :
A(mat_ops_data_ptr, tag) {
23 metaPiolaResponses.emplace(
25 boost::static_pointer_cast<MatPiolaResponse>(
26 createMatOpsPhysicalEquationsPtr<ELASTICITY::NEOHOOKEAN, modelType>(
27 this->matOpsDataPtr, default_tag)));
29 if constexpr (DIM == 3) {
30 const int mooney_tag =
32 metaPiolaResponses.emplace(
33 mooney_tag, boost::static_pointer_cast<MatPiolaResponse>(
36 this->matOpsDataPtr, mooney_tag)));
39 const int stvenant_tag =
41 metaPiolaResponses.emplace(
43 boost::static_pointer_cast<MatPiolaResponse>(
45 modelType>(this->matOpsDataPtr,
53 char umat_library[PETSC_MAX_PATH_LEN] =
"";
55 umat_library,
sizeof(umat_library),
58 if (umat_library[0] ||
64 metaPiolaResponses.insert(
65 {umat_tag, boost::static_pointer_cast<MatPiolaResponse>(
66 createMatOpsPhysicalEquationsPtr<UMAT, modelType>(
67 this->matOpsDataPtr, umat_tag))});
70 for (
auto &
m : metaPiolaResponses) {
71 CHKERR m.second->getOptions(m_field_ptr);
73 A::tagVsRangePtr = boost::make_shared<std::map<int, Range>>();
74 for (
const auto &
m : metaPiolaResponses) {
75 A::tagVsRangePtr->insert(
77 for (
auto &rp :
m.second->paramVecByRange) {
78 A::tagVsRangePtr->at(
m.first).merge(
89 bool has_ranges =
false;
90 if (A::tagVsRangePtr) {
91 for (
const auto &tag_range : *A::tagVsRangePtr) {
92 has_ranges = has_ranges || !tag_range.second.empty();
97 for (
auto &
m : metaPiolaResponses) {
98 CHKERR m.second->setParams(fe_ptr, gg);
103 for (
auto &
m : metaPiolaResponses) {
104 if (A::tagVsRangePtr->at(
m.first).find(ent) !=
105 A::tagVsRangePtr->at(
m.first).end()) {
106 CHKERR m.second->setParams(fe_ptr, gg);
112 "Meta Piola-response parameters not found for entity %lu",
113 static_cast<unsigned long>(ent));
119 for (
auto &
m : metaPiolaResponses) {
127 return metaPiolaResponses.at(tag)->evaluateVariable(tag, entity, gg);
132 return metaPiolaResponses.at(tag)->evaluateDerivatives(tag, entity, gg);
136 return metaPiolaResponses.at(tag)->updateState(tag, entity, gg);
140 return metaPiolaResponses;
144 static inline constexpr int modelType = MODEL_TYPE;
149std::map<int, boost::shared_ptr<MatPiolaResponse>> &
151 auto meta_response_3d_ptr =
152 boost::dynamic_pointer_cast<MatMetaPiolaResponse<3>>(meta_ptr);
153 if (meta_response_3d_ptr) {
154 return meta_response_3d_ptr->getMetaPiolaResponseMap();
156 auto meta_response_2d_ptr =
157 boost::dynamic_pointer_cast<MatMetaPiolaResponse<2>>(meta_ptr);
158 if (meta_response_2d_ptr) {
159 return meta_response_2d_ptr->getMetaPiolaResponseMap();
161 auto meta_response_axisymmetric_ptr = boost::dynamic_pointer_cast<
163 if (meta_response_axisymmetric_ptr) {
167 "Provided response pointer is not a MatMetaPiolaResponse");
168 static std::map<int, boost::shared_ptr<MatPiolaResponse>> empty_map;
173boost::shared_ptr<PhysicalEquations>
175 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
176 return boost::make_shared<MatMetaPiolaResponse<3>>(mat_ops_data_ptr, tag);
180boost::shared_ptr<PhysicalEquations>
182 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
183 return boost::make_shared<MatMetaPiolaResponse<2>>(mat_ops_data_ptr, tag);
187boost::shared_ptr<PhysicalEquations>
189 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
190 return boost::make_shared<MatMetaPiolaResponse<3, MODEL_AXISYMMETRIC>>(
191 mat_ops_data_ptr, tag);
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< PIOLA_RESPONSE::META, MODEL_AXISYMMETRIC >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< PIOLA_RESPONSE::META, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
std::map< int, boost::shared_ptr< MatPiolaResponse > > & getMetaPiolaResponseMap(boost::shared_ptr< MatPiolaResponse > meta_ptr)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< PIOLA_RESPONSE::META, MODEL_2D_PLANE_STRAIN >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
FTensor::Index< 'm', 3 > m
Deprecated interface functions.
Structure for user loop methods on finite elements.
EntityHandle getFEEntityHandle() const
Get the entity handle of the current finite element.
Interface for managing meshsets containing materials and boundary conditions.