20 :
A(mat_ops_data_ptr,
tag) {
24 metaPiolaResponses.emplace(
26 boost::static_pointer_cast<MatPiolaResponse>(
27 createMatOpsPhysicalEquationsPtr<ELASTICITY::NEOHOOKEAN, modelType>(
28 this->matOpsDataPtr, default_tag)));
31 if constexpr (DIM == 3) {
32 const int mooney_tag =
34 metaPiolaResponses.emplace(
35 mooney_tag, boost::static_pointer_cast<MatPiolaResponse>(
38 this->matOpsDataPtr, mooney_tag)));
42 const int stvenant_tag =
44 metaPiolaResponses.emplace(
46 boost::static_pointer_cast<MatPiolaResponse>(
48 modelType>(this->matOpsDataPtr,
57 char umat_library[PETSC_MAX_PATH_LEN] =
"";
59 umat_library,
sizeof(umat_library),
61 if (umat_library[0] ||
67 metaPiolaResponses.insert(
68 {umat_tag, boost::static_pointer_cast<MatPiolaResponse>(
69 createMatOpsPhysicalEquationsPtr<UMAT, modelType>(
70 this->matOpsDataPtr, umat_tag))});
73 for (
auto &
m : metaPiolaResponses) {
74 CHKERR m.second->getOptions(m_field_ptr);
81 A::tagVsRangePtr = boost::make_shared<std::map<int, Range>>();
82 for (
const auto &
m : metaPiolaResponses) {
83 A::tagVsRangePtr->insert(
85 for (
auto &rp :
m.second->paramVecByRange) {
86 A::tagVsRangePtr->at(
m.first).merge(
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();
105 for (
auto &
m : metaPiolaResponses) {
106 CHKERR m.second->setParams(fe_ptr, gg);
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);
120 "Meta Piola-response parameters not found for entity %lu",
121 static_cast<unsigned long>(ent));
127 for (
auto &
m : metaPiolaResponses) {
135 return metaPiolaResponses.at(
tag)->evaluateVariable(
tag, entity, gg);
140 return metaPiolaResponses.at(
tag)->evaluateDerivatives(
tag, entity, gg);
144 return metaPiolaResponses.at(
tag)->updateState(
tag, entity, gg);
148 return metaPiolaResponses;
152 static inline constexpr int modelType = MODEL_TYPE;
157std::map<int, boost::shared_ptr<MatPiolaResponse>> &
159 auto meta_response_3d_ptr =
160 boost::dynamic_pointer_cast<MatMetaPiolaResponse<3>>(meta_ptr);
161 if (meta_response_3d_ptr) {
162 return meta_response_3d_ptr->getMetaPiolaResponseMap();
164 auto meta_response_2d_ptr =
165 boost::dynamic_pointer_cast<MatMetaPiolaResponse<2>>(meta_ptr);
166 if (meta_response_2d_ptr) {
167 return meta_response_2d_ptr->getMetaPiolaResponseMap();
169 auto meta_response_axisymmetric_ptr =
170 boost::dynamic_pointer_cast<MatMetaPiolaResponse<3, MODEL_AXISYMMETRIC>>(
172 if (meta_response_axisymmetric_ptr) {
173 return meta_response_axisymmetric_ptr->getMetaPiolaResponseMap();
176 "Provided response pointer is not a MatMetaPiolaResponse");
177 static std::map<int, boost::shared_ptr<MatPiolaResponse>> empty_map;
182boost::shared_ptr<PhysicalEquations>
184 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
185 return boost::make_shared<MatMetaPiolaResponse<3>>(mat_ops_data_ptr,
tag);
189boost::shared_ptr<PhysicalEquations>
191 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
192 return boost::make_shared<MatMetaPiolaResponse<2>>(mat_ops_data_ptr,
tag);
196boost::shared_ptr<PhysicalEquations>
198 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag) {
199 return boost::make_shared<MatMetaPiolaResponse<3, MODEL_AXISYMMETRIC>>(
200 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.