58#ifdef __NONLINEAR_ELASTIC_HPP
60 const std::map<int, NonlinearElasticElement::BlockData>
61 *setOfBlocksMaterialDataPtr;
70 std::vector<EntityHandle> &map_gauss_pts,
71 Range &post_proc_elements,
73 boost::shared_ptr<MatrixDouble> field_gradient_ptr,
74#ifdef __NONLINEAR_ELASTIC_HPP
75 const std::map<int, NonlinearElasticElement::BlockData>
76 *set_of_block_data_ptr = NULL,
78 const bool is_field_disp =
true)
83#ifdef __NONLINEAR_ELASTIC_HPP
84 setOfBlocksMaterialDataPtr(set_of_block_data_ptr),
113 CHKERR it->getAttributeDataStructure(mydata);
118 meshsets.insert(it->meshset);
119 for (Range::iterator mit = meshsets.begin(); mit != meshsets.end();
122 *_lambda =
LAMBDA(mydata.data.Young, mydata.data.Poisson);
123 *_mu =
MU(mydata.data.Young, mydata.data.Poisson);
124 *_block_id = it->getMeshsetId();
125#ifdef __NONLINEAR_ELASTIC_HPP
126 if (setOfBlocksMaterialDataPtr) {
128 LAMBDA(setOfBlocksMaterialDataPtr->at(*_block_id).E,
129 setOfBlocksMaterialDataPtr->at(*_block_id).PoissonRatio);
130 *_mu =
MU(setOfBlocksMaterialDataPtr->at(*_block_id).E,
131 setOfBlocksMaterialDataPtr->at(*_block_id).PoissonRatio);
140 "Element is not in elastic block, however you run linear elastic "
141 "analysis with that element\n"
142 "top tip: check if you update block sets after mesh refinements or "
143 "interface insertion");
152 EntitiesFieldData::EntData &data) {
155 if (
type != MBVERTEX)
157 if (data.getFieldData().size() == 0)
164 MatrixDouble D_lambda, D_mu,
D;
165 D_lambda.resize(6, 6);
167 for (
int rr = 0; rr < 3; rr++) {
168 for (
int cc = 0; cc < 3; cc++) {
169 D_lambda(rr, cc) = 1;
174 for (
int rr = 0; rr < 6; rr++) {
175 D_mu(rr, rr) = rr < 3 ? 2 : 1;
180 double def_VAL[tag_length];
181 bzero(def_VAL, tag_length *
sizeof(
double));
184 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
187 int def_block_id = -1;
189 MB_TAG_CREAT | MB_TAG_SPARSE,
197 int nb_gauss_pts = data.getN().size1();
198 if (
mapGaussPts.size() != (
unsigned int)nb_gauss_pts)
205 "Gradient of field %s is not available",
rowFieldName.c_str());
209 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
226 noalias(stress) = prod(
D, strain);
229 Stress(0, 0) = stress[0];
230 Stress(1, 1) = stress[1];
231 Stress(2, 2) = stress[2];
232 Stress(0, 1) = Stress(1, 0) = stress[3];
233 Stress(1, 2) = Stress(2, 1) = stress[4];
234 Stress(2, 0) = Stress(0, 2) = stress[5];
ForcesAndSourcesCore::UserDataOperator UserDataOperator
DEPRECATED typedef PostProcHookStress PostPorcHookStress
SmartPetscObj< Vec > gradient
#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 ...
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
friend class ForcesAndSourcesCore
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
@ OPROW
operator doWork function is executed on FE rows
Operator post-procesing stresses for Hook isotropic material.
boost::shared_ptr< MatrixDouble > fieldGradientPtr
moab::Interface & postProcMesh
MoFEM::Interface & mField
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Here real work is done.
MoFEMErrorCode getMatParameters(double *_lambda, double *_mu, int *_block_id)
get material parameter
PostProcHookStress(MoFEM::Interface &m_field, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, Range &post_proc_elements, const std::string field_name, boost::shared_ptr< MatrixDouble > field_gradient_ptr, const bool is_field_disp=true)
std::vector< EntityHandle > & mapGaussPts