10#ifndef __POSTPROCSTRESSES_HPP__
11#define __POSTPROCSTRESSES_HPP__
14#error "MoFEM need to be compiled with ADOL-C"
31 std::vector<EntityHandle> &map_gauss_pts,
35 const bool field_disp =
false,
36 const bool replace_nonanumber_by_max_value =
false,
37 const double max_val = 1e16,
38 const bool print_cauchy_stress =
false)
49 EntitiesFieldData::EntData &data) {
54 if (data.getIndices().size() == 0)
61 const auto &dof_ptr = data.getFieldDofs()[0];
66 int def_block_id = -1;
68 MB_TAG_CREAT | MB_TAG_SPARSE,
75 string tag_name_piola1 = dof_ptr->getName() +
"_PIOLA1_STRESS";
76 string tag_name_energy = dof_ptr->getName() +
"_ENERGY_DENSITY";
79 double def_VAL[tag_length];
80 bzero(def_VAL, tag_length *
sizeof(
double));
81 Tag th_piola1, th_energy, th_cauchy;
83 MB_TYPE_DOUBLE, th_piola1,
84 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
86 MB_TYPE_DOUBLE, th_energy,
87 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
90 string tag_name_cauchy =
"MED_" + dof_ptr->getName() +
"_CAUCHY_STRESS";
92 MB_TYPE_DOUBLE, th_cauchy,
93 MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
96 int nb_gauss_pts = data.getN().size1();
97 if (
mapGaussPts.size() != (
unsigned int)nb_gauss_pts) {
99 "Nb. of integration points is not equal to number points on "
100 "post-processing mesh");
104 "Gradient of field not found, filed <%s> not found",
108 MatrixDouble3by3
H, invH;
119 MatrixDouble3by3 maxP(3, 3);
122 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
129 for (
int dd = 0; dd != 3; dd++) {
134 (
unsigned int)nb_gauss_pts) {
138 detH = determinantTensor3by3(
H);
139 CHKERR invertTensor3by3(
H, detH, invH);
144 int nb_active_variables = 9;
146 nb_active_variables);
166 MatrixDouble3by3 P(3, 3);
167 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
171 if (!std::isnormal(val_energy)) {
176 for (
unsigned int r = 0; r != P.size1(); ++r) {
177 for (
unsigned int c = 0;
c != P.size2(); ++
c) {
178 if (!std::isnormal(P(r,
c)))
179 P(r,
c) = copysign(
maxVal, P(r,
c));
ForcesAndSourcesCore::UserDataOperator UserDataOperator
DEPRECATED typedef PostProcStress PostPorcStress
#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_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
const double c
speed of light (cm/ns)
implementation of Data Operators for Forces and Sources
constexpr auto field_name
friend class ForcesAndSourcesCore
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
@ OPROW
operator doWork function is executed on FE rows
data for calculation heat conductivity and heat capacity elements
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > > materialDoublePtr
Range tEts
constrains elements in block set
common data used by volume elements
std::map< std::string, std::vector< VectorDouble > > dataAtGaussPts
std::map< std::string, std::vector< MatrixDouble > > gradAtGaussPts
std::map< std::string, std::vector< VectorDouble > > fieldMap
std::map< std::string, std::vector< MatrixDouble > > gradMap
PostProcCommonOnRefMesh::CommonDataForVolume & commonData
PostProcStress(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, const std::string field_name, NonlinearElasticElement::BlockData &data, PostProcCommonOnRefMesh::CommonDataForVolume &common_data, const bool field_disp=false, const bool replace_nonanumber_by_max_value=false, const double max_val=1e16, const bool print_cauchy_stress=false)
NonlinearElasticElement::BlockData & dAta
const bool replaceNonANumberByMaxValue
std::vector< EntityHandle > & mapGaussPts
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
moab::Interface & postProcMesh
NonlinearElasticElement::CommonData nonLinearElementCommonData