v0.15.0
Loading...
Searching...
No Matches
EshelbianPlasticity::OpPostProcDataStructure Struct Reference

#include "users_modules/eshelbian_plasticity/src/EshelbianPlasticity.hpp"

Inheritance diagram for EshelbianPlasticity::OpPostProcDataStructure:
[legend]
Collaboration diagram for EshelbianPlasticity::OpPostProcDataStructure:
[legend]

Public Types

using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator
 

Public Member Functions

 OpPostProcDataStructure (moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< DataAtIntegrationPts > data_ptr, int sense)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Public Attributes

moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 

Private Attributes

int tagSense
 

Detailed Description

Definition at line 880 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ OP

using EshelbianPlasticity::OpPostProcDataStructure::OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator

Definition at line 883 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpPostProcDataStructure()

EshelbianPlasticity::OpPostProcDataStructure::OpPostProcDataStructure ( moab::Interface & post_proc_mesh,
std::vector< EntityHandle > & map_gauss_pts,
boost::shared_ptr< DataAtIntegrationPts > data_ptr,
int sense )
inline

Definition at line 889 of file EshelbianPlasticity.hpp.

923 {
924
925struct CGGUserPolynomialBase : public TetPolynomialBase {
926
927 using CachePhi = boost::tuple<int, int, MatrixDouble>;
928
929 CGGUserPolynomialBase(boost::shared_ptr<CachePhi> cache_phi = nullptr);
930 ~CGGUserPolynomialBase() = default;
931
932 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
933 BaseFunctionUnknownInterface **iface) const;
934 MoFEMErrorCode getValue(MatrixDouble &pts,
935 boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
936
937private:
938 MatrixDouble shapeFun;
939 boost::shared_ptr<CachePhi> cachePhiPtr;
940
941 MoFEMErrorCode getValueHdivForCGGBubble(MatrixDouble &pts);
942};
943
944struct ContactTree;
945
948enum StretchSelector {
949 LINEAR,
950 LOG /*linar extenion*/,
951 LOG_QUADRATIC /*quadratic extension*/,
953};
955
956using MatrixPtr = boost::shared_ptr<MatrixDouble>;
957using VectorPtr = boost::shared_ptr<VectorDouble>;
958
959using EntData = EntitiesFieldData::EntData;
960using UserDataOperator = ForcesAndSourcesCore::UserDataOperator;
961using VolUserDataOperator = VolumeElementForcesAndSourcesCore::UserDataOperator;
962using FaceUserDataOperator = FaceElementForcesAndSourcesCore::UserDataOperator;
963using EleOnSide = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle;
964using SideEleOp = EleOnSide::UserDataOperator;
965
966struct PhysicalEquations;
967
968struct AnalyticalExprPython;
969
971 : public boost::enable_shared_from_this<DataAtIntegrationPts> {
972
973 MatrixDouble approxPAtPts;
974 MatrixDouble approxSigmaAtPts;
975 MatrixDouble divPAtPts;
976 MatrixDouble divSigmaAtPts;
977 MatrixDouble wL2AtPts;
978 MatrixDouble wL2DotAtPts;
979 MatrixDouble wL2DotDotAtPts;
980 MatrixDouble logStretchTensorAtPts;
981 MatrixDouble stretchTensorAtPts;
982 VectorDouble jacobianAtPts;
983 MatrixDouble tractionAtPts;
984
985 MatrixDouble diffStretchTensorAtPts;
986 VectorDouble detStretchTensorAtPts;
987 MatrixDouble detStretchTensorAtPts_du;
988 MatrixDouble logStretchDotTensorAtPts;
989 MatrixDouble gradLogStretchDotTensorAtPts;
990 MatrixDouble rotAxisAtPts;
991 MatrixDouble rotAxisDotAtPts;
992 MatrixDouble rotAxisGradDotAtPts;
993 MatrixDouble rotAxis0AtPts;
994 MatrixDouble WAtPts;
995 MatrixDouble W0AtPts;
996 MatrixDouble GAtPts;
997 MatrixDouble G0AtPts;
998 MatrixDouble wH1AtPts;
999 MatrixDouble XH1AtPts;
1000 MatrixDouble contactL2AtPts;
1001 MatrixDouble wGradH1AtPts;
1002 MatrixDouble logStretch2H1AtPts;
1003 MatrixDouble logStretchTotalTensorAtPts;
1004
1005 MatrixDouble hAtPts;
1006 MatrixDouble hdOmegaAtPts;
1007 MatrixDouble hdLogStretchAtPts;
1008 MatrixDouble leviKirchhoffAtPts;
1009 MatrixDouble leviKirchhoffdOmegaAtPts;
1010 MatrixDouble leviKirchhoffdLogStreatchAtPts;
1011 MatrixDouble leviKirchhoffPAtPts;
1012 MatrixDouble adjointPdstretchAtPts;
1013 MatrixDouble adjointPdUAtPts;
1014 MatrixDouble adjointPdUdOmegaAtPts;
1015 MatrixDouble adjointPdUdPAtPts;
1016 MatrixDouble rotMatAtPts;
1017 MatrixDouble PAtPts;
1018 MatrixDouble SigmaAtPts;
1019 VectorDouble energyAtPts; //< this is density of energy at integration points
1020 MatrixDouble flowL2AtPts;
1021
1022 MatrixDouble varRotAxis;
1023 MatrixDouble varLogStreach;
1024 MatrixDouble varPiola;
1025 MatrixDouble varDivPiola;
1026 MatrixDouble varWL2;
1027
1028 MatrixDouble P_du;
1029
1030 MatrixDouble eigenVals;
1031 MatrixDouble eigenVecs;
1032 VectorInt nbUniq;
1033 MatrixDouble eigenValsC;
1034 MatrixDouble eigenVecsC;
1035 VectorInt nbUniqC;
1036
1037 MatrixDouble matD;
1038 MatrixDouble matAxiatorD;
1039 MatrixDouble matDeviatorD;
1040 MatrixDouble matInvD;
1041
1042 MatrixDouble internalStressAtPts;
1043
1044 MatrixDouble facePiolaAtPts;
1045 MatrixDouble gradHybridDispAtPts;
1046 MatrixDouble faceMaterialForceAtPts;
1047 VectorDouble normalPressureAtPts;
1048
1049 double mu;
1050 double lambda;
1051 double piolaScale = 1.;
1052 double faceEnergy = 0.;
1053
1054 inline auto getPiolaScalePtr() {
1055 return boost::shared_ptr<double>(shared_from_this(), &piolaScale);
1056 }
1057
1058 inline MatrixPtr getApproxSigmaAtPts() {
1059 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1060 &approxSigmaAtPts);
1061 }
1062 inline MatrixPtr getApproxPAtPts() {
1063 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &approxPAtPts);
1064 }
1065
1066 inline MatrixPtr getDivPAtPts() {
1067 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &divPAtPts);
1068 }
1069
1070 inline MatrixPtr getDivSigmaAtPts() {
1071 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &divSigmaAtPts);
1072 }
1073
1074 inline MatrixPtr getSmallWL2AtPts() {
1075 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &wL2AtPts);
1076 }
1077
1078 inline MatrixPtr getSmallWL2DotAtPts() {
1079 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &wL2DotAtPts);
1080 }
1081
1082 inline MatrixPtr getSmallWL2DotDotAtPts() {
1083 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &wL2DotDotAtPts);
1084 }
1085
1086 inline MatrixPtr getLogStretchTensorAtPts() {
1087 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1088 &logStretchTensorAtPts);
1089 }
1090
1091 inline MatrixPtr getStretchTensorAtPts() {
1092 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1093 &stretchTensorAtPts);
1094 }
1095
1096 inline MatrixPtr getLogStretchDotTensorAtPts() {
1097 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1098 &logStretchDotTensorAtPts);
1099 }
1100
1101 inline MatrixPtr getGradLogStretchDotTensorAtPts() {
1102 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1103 &gradLogStretchDotTensorAtPts);
1104 }
1105
1106 inline MatrixPtr getRotAxisAtPts() {
1107 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &rotAxisAtPts);
1108 }
1109
1110 inline MatrixPtr getRotAxis0AtPts() {
1111 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &rotAxis0AtPts);
1112 }
1113
1114 inline MatrixPtr getRotAxisDotAtPts() {
1115 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1116 &rotAxisDotAtPts);
1117 }
1118
1119 inline MatrixPtr getRotAxisGradDotAtPts() {
1120 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1121 &rotAxisGradDotAtPts);
1122 }
1123
1124 inline MatrixPtr getBigGAtPts() {
1125 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &GAtPts);
1126 }
1127
1128 inline MatrixPtr getBigG0AtPts() {
1129 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &GAtPts);
1130 }
1131
1132 inline MatrixPtr getMatDPtr() {
1133 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &matD);
1134 }
1135
1136 inline MatrixPtr getMatInvDPtr() {
1137 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &matInvD);
1138 }
1139
1140 inline MatrixPtr getMatAxiatorDPtr() {
1141 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &matAxiatorD);
1142 }
1143
1144 inline MatrixPtr getMatDeviatorDPtr() {
1145 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &matDeviatorD);
1146 }
1147
1148 inline MatrixPtr getSmallWH1AtPts() {
1149 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &wH1AtPts);
1150 }
1151
1152 inline MatrixPtr getLargeXH1AtPts() {
1153 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &XH1AtPts);
1154 }
1155
1156 inline MatrixPtr getContactL2AtPts() {
1157 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &contactL2AtPts);
1158 }
1159
1160 inline MatrixPtr getSmallWGradH1AtPts() {
1161 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &wGradH1AtPts);
1162 }
1163
1164 inline VectorPtr getJacobianAtPts() {
1165 return boost::shared_ptr<VectorDouble>(shared_from_this(), &jacobianAtPts);
1166 }
1167
1168 inline MatrixPtr getLeviKirchhoffAtPts() {
1169 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1170 &leviKirchhoffAtPts);
1171 };
1172
1173 inline MatrixPtr getVarRotAxisPts() {
1174 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &varRotAxis);
1175 }
1176
1177 inline MatrixPtr getVarLogStreachPts() {
1178 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &varLogStreach);
1179 }
1180
1181 inline MatrixPtr getVarPiolaPts() {
1182 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &varPiola);
1183 }
1184
1185 inline MatrixPtr getDivVarPiolaPts() {
1186 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &varDivPiola);
1187 }
1188
1189 inline MatrixPtr getVarWL2Pts() {
1190 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &varWL2);
1191 }
1192
1193 inline MatrixPtr getInternalStressAtPts() {
1194 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1195 &internalStressAtPts);
1196 }
1197
1198 inline MatrixPtr getFacePiolaAtPts() {
1199 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &facePiolaAtPts);
1200 }
1201
1202 inline MatrixPtr getGradHybridDispAtPts() {
1203 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
1204 &gradHybridDispAtPts);
1205 }
1206
1207 inline MatrixPtr getEigenValsAtPts() {
1208 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &eigenVals);
1209 }
1210
1211 boost::shared_ptr<PhysicalEquations> physicsPtr;
1212};
1213
1214struct OpJacobian;
1215
1216// Forward declarations
1217struct ExternalStrain;
1218using ExternalStrainVec = std::vector<ExternalStrain>;
1219struct PhysicalEquations {
1220
1221 typedef FTensor::Tensor1<adouble, 3> ATensor1;
1222 typedef FTensor::Tensor2<adouble, 3, 3> ATensor2;
1223 typedef FTensor::Tensor3<adouble, 3, 3, 3> ATensor3;
1224 typedef FTensor::Tensor1<double, 3> DTensor1;
1225 typedef FTensor::Tensor2<double, 3, 3> DTensor2;
1226 typedef FTensor::Tensor3<double, 3, 3, 3> DTensor3;
1227
1229
1230 typedef FTensor::Tensor2<FTensor::PackPtr<double *, 1>, 3, 3> DTensor2Ptr;
1231 typedef FTensor::Tensor3<FTensor::PackPtr<double *, 1>, 3, 3, 3> DTensor3Ptr;
1232
1233 PhysicalEquations() = delete;
1234 PhysicalEquations(const int size_active, const int size_dependent)
1235 : activeVariables(size_active, 0),
1236 dependentVariablesPiola(size_dependent, 0),
1237 dependentVariablesPiolaDirevatives(size_dependent * size_active, 0) {}
1238 virtual ~PhysicalEquations() = default;
1239
1240 virtual MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h) = 0;
1241
1242 virtual UserDataOperator *
1243 returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
1244 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1245 boost::shared_ptr<PhysicalEquations> physics_ptr);
1246
1247 virtual VolUserDataOperator *
1248 returnOpSpatialPhysical(const std::string &field_name,
1249 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1250 const double alpha_u);
1251
1252 virtual VolUserDataOperator *
1253 returnOpSpatialPhysicalExternalStrain(
1254 const std::string &field_name,
1255 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1256 boost::shared_ptr<ExternalStrainVec> external_strain_vec_ptr,
1257 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv);
1258
1259 virtual VolUserDataOperator *returnOpSpatialPhysical_du_du(
1260 std::string row_field, std::string col_field,
1261 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const double alpha);
1262
1263 virtual VolUserDataOperator *
1264 returnOpCalculateEnergy(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1265 boost::shared_ptr<double> total_energy_ptr);
1266
1267 virtual VolUserDataOperator *returnOpCalculateStretchFromStress(
1268 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1269 boost::shared_ptr<PhysicalEquations> physics_ptr);
1270
1271 virtual VolUserDataOperator *returnOpCalculateVarStretchFromStress(
1272 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1273 boost::shared_ptr<PhysicalEquations> physics_ptr);
1274
1275 virtual VolUserDataOperator *
1276 returnOpSetScale(boost::shared_ptr<double> scale_ptr,
1277 boost::shared_ptr<PhysicalEquations> physics_ptr);
1278
1279 std::vector<double> activeVariables;
1280 std::vector<double> dependentVariablesPiola;
1281 std::vector<double> dependentVariablesPiolaDirevatives;
1282
1283 /** \name Active variables */
1284
1285 /**@{*/
1286
1287 template <int S>
1288 inline static DTensor2Ptr get_VecTensor2(std::vector<double> &v) {
1289 return DTensor2Ptr(&v[S + 0], &v[S + 1], &v[S + 2], &v[S + 3], &v[S + 4],
1290 &v[S + 5], &v[S + 6], &v[S + 7], &v[S + 8]);
1291 }
1292
1293 template <int S>
1294 inline static DTensor0Ptr get_VecTensor0(std::vector<double> &v) {
1295 return DTensor0Ptr(&v[S + 0]);
1296 }
1297
1298 template <int S0>
1299 inline static DTensor3Ptr get_vecTensor3(std::vector<double> &v,
1300 const int nba) {
1301
1302 const int A00 = nba * 0 + S0;
1303 const int A01 = nba * 1 + S0;
1304 const int A02 = nba * 2 + S0;
1305 const int A10 = nba * 3 + S0;
1306 const int A11 = nba * 4 + S0;
1307 const int A12 = nba * 5 + S0;
1308 const int A20 = nba * 6 + S0;
1309 const int A21 = nba * 7 + S0;
1310 const int A22 = nba * 8 + S0;
1311
1312 return DTensor3Ptr(
1313
1314 &v[A00 + 0], &v[A00 + 1], &v[A00 + 2], &v[A01 + 0], &v[A01 + 1],
1315 &v[A01 + 2], &v[A02 + 0], &v[A02 + 1], &v[A02 + 2],
1316
1317 &v[A10 + 0], &v[A10 + 1], &v[A10 + 2], &v[A11 + 0], &v[A11 + 1],
1318 &v[A11 + 2], &v[A12 + 0], &v[A12 + 1], &v[A12 + 2],
1319
1320 &v[A20 + 0], &v[A20 + 1], &v[A20 + 2], &v[A21 + 0], &v[A21 + 1],
1321 &v[A21 + 2], &v[A22 + 0], &v[A22 + 1], &v[A22 + 2]
1322
1323 );
1324 }
1325
1326 /**@}*/
1327
1328 /** \name Active variables */
1329
1330 /**@{*/
1331
1332 inline DTensor2Ptr get_h() { return get_VecTensor2<0>(activeVariables); }
1333
1334 /**@}*/
1335
1336 /** \name Dependent variables */
1337
1338 /**@{*/
1339
1340 inline DTensor2Ptr get_P() {
1341 return get_VecTensor2<0>(dependentVariablesPiola);
1342 }
1343
1344 /**@}*/
1345
1346 /** \name Derivatives of dependent variables */
1347
1348 /**@{*/
1349
1350 inline DTensor3Ptr get_P_dh0() {
1351 return get_vecTensor3<0>(dependentVariablesPiolaDirevatives,
1352 activeVariables.size());
1353 }
1354 inline DTensor3Ptr get_P_dh1() {
1355 return get_vecTensor3<3>(dependentVariablesPiolaDirevatives,
1356 activeVariables.size());
1357 }
1358 inline DTensor3Ptr get_P_dh2() {
1359 return get_vecTensor3<6>(dependentVariablesPiolaDirevatives,
1360 activeVariables.size());
1361 }
1362
1363 /**@}*/
1364};
1365
1366struct BcDisp {
1367 BcDisp(std::string name, std::vector<double> attr, Range faces);
1368 std::string blockName;
1369 Range faces;
1370 VectorDouble3 vals;
1371 VectorInt3 flags;
1372};
1373using BcDispVec = std::vector<BcDisp>;
1374
1375struct BcRot {
1376 BcRot(std::string name, std::vector<double> attr, Range faces);
1377 std::string blockName;
1378 Range faces;
1379 VectorDouble vals;
1380 double theta;
1381};
1382using BcRotVec = std::vector<BcRot>;
1383
1384typedef std::vector<Range> TractionFreeBc;
1385
1386struct TractionBc {
1387 TractionBc(std::string name, std::vector<double> attr, Range faces);
1388 std::string blockName;
1389 Range faces;
1390 VectorDouble3 vals;
1391 VectorInt3 flags;
1392};
1393using TractionBcVec = std::vector<TractionBc>;
1394
1395struct NormalDisplacementBc {
1396 NormalDisplacementBc(std::string name, std::vector<double> attr, Range faces);
1397 std::string blockName;
1398 Range faces;
1399 double val;
1400};
1401using NormalDisplacementBcVec = std::vector<NormalDisplacementBc>;
1402
1403struct AnalyticalDisplacementBc {
1404 AnalyticalDisplacementBc(std::string name, std::vector<double> attr,
1405 Range faces);
1406 std::string blockName;
1407 Range faces;
1408 VectorInt3 flags;
1409};
1410using AnalyticalDisplacementBcVec = std::vector<AnalyticalDisplacementBc>;
1411
1412struct AnalyticalTractionBc {
1413 AnalyticalTractionBc(std::string name, std::vector<double> attr, Range faces);
1414 std::string blockName;
1415 Range faces;
1416 VectorInt3 flags;
1417};
1418using AnalyticalTractionBcVec = std::vector<AnalyticalTractionBc>;
1419
1420struct PressureBc {
1421 PressureBc(std::string name, std::vector<double> attr, Range faces);
1422 std::string blockName;
1423 Range faces;
1424 double val;
1425};
1426using PressureBcVec = std::vector<PressureBc>;
1427
1428struct ExternalStrain {
1429 ExternalStrain(std::string name, std::vector<double> attr, Range ents);
1430 std::string blockName;
1431 Range ents;
1432 double val;
1433 double bulkModulusK;
1434};
1435
1436 #ifdef ENABLE_PYTHON_BINDING
1437struct AnalyticalExprPython {
1438 AnalyticalExprPython() = default;
1439 virtual ~AnalyticalExprPython() = default;
1440
1441 MoFEMErrorCode analyticalExprInit(const std::string py_file);
1442 MoFEMErrorCode evalAnalyticalDisp(double delta_t, double t, np::ndarray x,
1443 np::ndarray y, np::ndarray z,
1444 np::ndarray nx, np::ndarray ny,
1445 np::ndarray nz,
1446 const std::string &block_name,
1447 np::ndarray &analytical_expr);
1448 MoFEMErrorCode evalAnalyticalTraction(double delta_t, double t, np::ndarray x,
1449 np::ndarray y, np::ndarray z,
1450 np::ndarray nx, np::ndarray ny,
1451 np::ndarray nz,
1452 const std::string &block_name,
1453 np::ndarray &analytical_expr);
1454
1455 template <typename T>
1456 inline std::vector<T>
1457 py_list_to_std_vector(const boost::python::object &iterable) {
1458 return std::vector<T>(boost::python::stl_input_iterator<T>(iterable),
1459 boost::python::stl_input_iterator<T>());
1460 }
1461
1462private:
1463 bp::object mainNamespace;
1464 bp::object analyticalDispFun;
1465 bp::object analyticalTractionFun;
1466};
1467
1468extern boost::weak_ptr<AnalyticalExprPython> AnalyticalExprPythonWeakPtr;
1469 #endif
1470
1471 #include "EshelbianCore.hpp"
1472 #include "EshelbianOperators.hpp"
1473
1474} // namespace EshelbianPlasticity
1475
1476#endif //__ESHELBIAN_PLASTICITY_HPP__
ForcesAndSourcesCore::UserDataOperator UserDataOperator
static double lambda
const double v
phase velocity of light in medium (cm/ns)
boost::shared_ptr< VectorDouble > VectorPtr
std::vector< AnalyticalTractionBc > AnalyticalTractionBcVec
std::vector< BcDisp > BcDispVec
std::vector< NormalDisplacementBc > NormalDisplacementBcVec
std::vector< BcRot > BcRotVec
std::vector< ExternalStrain > ExternalStrainVec
std::vector< AnalyticalDisplacementBc > AnalyticalDisplacementBcVec
std::vector< Range > TractionFreeBc
std::vector< PressureBc > PressureBcVec
std::vector< TractionBc > TractionBcVec
boost::shared_ptr< MatrixDouble > MatrixPtr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
constexpr double t
plate stiffness
Definition plate.cpp:58
constexpr auto field_name
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle EleOnSide
Data on single entity (This is passed as argument to DataOperator::doWork)

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpPostProcDataStructure::doWork ( int side,
EntityType type,
EntData & data )
Examples
EshelbianOperators.cpp.

Definition at line 3087 of file EshelbianOperators.cpp.

3088 {
3090
3091 if (tagSense != getSkeletonSense())
3093
3094 auto get_tag = [&](auto name) {
3095 auto &mob = getPtrFE()->mField.get_moab();
3096 Tag tag;
3097 CHK_MOAB_THROW(mob.tag_get_handle(name, tag), "get tag");
3098 return tag;
3099 };
3100
3101 auto get_tag_value = [&](auto &&tag, int dim) {
3102 auto &mob = getPtrFE()->mField.get_moab();
3103 auto face = getSidePtrFE()->getFEEntityHandle();
3104 std::vector<double> value(dim);
3105 CHK_MOAB_THROW(mob.tag_get_data(tag, &face, 1, value.data()), "set tag");
3106 return value;
3107 };
3108
3109 auto create_tag = [this](const std::string tag_name, const int size) {
3110 double def_VAL[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
3111 Tag th;
3112 CHKERR postProcMesh.tag_get_handle(tag_name.c_str(), size, MB_TYPE_DOUBLE,
3113 th, MB_TAG_CREAT | MB_TAG_SPARSE,
3114 def_VAL);
3115 return th;
3116 };
3117
3118 Tag th_cauchy_streess = create_tag("CauchyStress", 9);
3119 Tag th_detF = create_tag("detF", 1);
3120 Tag th_traction = create_tag("traction", 3);
3121 Tag th_disp_error = create_tag("DisplacementError", 1);
3122
3123 Tag th_energy = create_tag("Energy", 1);
3124
3125 auto t_w = getFTensor1FromMat<3>(dataAtPts->wL2AtPts);
3126 auto t_h = getFTensor2FromMat<3, 3>(dataAtPts->hAtPts);
3127 auto t_approx_P = getFTensor2FromMat<3, 3>(dataAtPts->approxPAtPts);
3128
3129 auto t_normal = getFTensor1NormalsAtGaussPts();
3130 auto t_disp = getFTensor1FromMat<3>(dataAtPts->wH1AtPts);
3131
3132 auto next = [&]() {
3133 ++t_w;
3134 ++t_h;
3135 ++t_approx_P;
3136 ++t_normal;
3137 ++t_disp;
3138 };
3139
3140 if (dataAtPts->energyAtPts.size() == 0) {
3141 // that is for case that energy is not calculated
3142 dataAtPts->energyAtPts.resize(getGaussPts().size2());
3143 dataAtPts->energyAtPts.clear();
3144 }
3145 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
3146
3147 FTensor::Index<'i', 3> i;
3148 FTensor::Index<'j', 3> j;
3149 FTensor::Index<'k', 3> k;
3150 FTensor::Index<'l', 3> l;
3151
3152 auto set_float_precision = [](const double x) {
3153 if (std::abs(x) < std::numeric_limits<float>::epsilon())
3154 return 0.;
3155 else
3156 return x;
3157 };
3158
3159 // scalars
3160 auto save_scal_tag = [&](auto &th, auto v, const int gg) {
3162 v = set_float_precision(v);
3163 CHKERR postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1, &v);
3165 };
3166
3167 // vectors
3168 VectorDouble3 v(3);
3169 FTensor::Tensor1<FTensor::PackPtr<double *, 0>, 3> t_v(&v[0], &v[1], &v[2]);
3170 auto save_vec_tag = [&](auto &th, auto &t_d, const int gg) {
3172 t_v(i) = t_d(i);
3173 for (auto &a : v.data())
3174 a = set_float_precision(a);
3175 CHKERR postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
3176 &*v.data().begin());
3178 };
3179
3180 // tensors
3181
3182 MatrixDouble3by3 m(3, 3);
3184 &m(0, 0), &m(0, 1), &m(0, 2),
3185
3186 &m(1, 0), &m(1, 1), &m(1, 2),
3187
3188 &m(2, 0), &m(2, 1), &m(2, 2));
3189
3190 auto save_mat_tag = [&](auto &th, auto &t_d, const int gg) {
3192 t_m(i, j) = t_d(i, j);
3193 for (auto &v : m.data())
3194 v = set_float_precision(v);
3195 CHKERR postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
3196 &*m.data().begin());
3198 };
3199
3200 const auto nb_gauss_pts = getGaussPts().size2();
3201 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
3202
3203 FTensor::Tensor1<double, 3> t_traction;
3204 t_traction(i) = t_approx_P(i, j) * t_normal(j) / t_normal.l2();
3205 // vectors
3206 CHKERR save_vec_tag(th_traction, t_traction, gg);
3207
3208 double u_error = sqrt((t_disp(i) - t_w(i)) * (t_disp(i) - t_w(i)));
3209 CHKERR save_scal_tag(th_disp_error, u_error, gg);
3210 CHKERR save_scal_tag(th_energy, t_energy, gg);
3211
3212 const double jac = determinantTensor3by3(t_h);
3214 t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
3215 CHKERR save_mat_tag(th_cauchy_streess, t_cauchy, gg);
3216 CHKERR postProcMesh.tag_set_data(th_detF, &mapGaussPts[gg], 1, &jac);
3217
3218 next();
3219 }
3220
3222}
constexpr double a
#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 ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
VectorBoundedArray< double, 3 > VectorDouble3
Definition Types.hpp:92
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) form data matrix.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
FTensor::Index< 'm', 3 > m
boost::shared_ptr< DataAtIntegrationPts > dataAtPts

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpPostProcDataStructure::dataAtPts
Examples
EshelbianOperators.cpp.

Definition at line 887 of file EshelbianPlasticity.hpp.

◆ mapGaussPts

std::vector<EntityHandle>& EshelbianPlasticity::OpPostProcDataStructure::mapGaussPts
Examples
EshelbianOperators.cpp.

Definition at line 886 of file EshelbianPlasticity.hpp.

◆ postProcMesh

moab::Interface& EshelbianPlasticity::OpPostProcDataStructure::postProcMesh
Examples
EshelbianOperators.cpp.

Definition at line 885 of file EshelbianPlasticity.hpp.

◆ tagSense

int EshelbianPlasticity::OpPostProcDataStructure::tagSense
private
Examples
EshelbianOperators.cpp.

Definition at line 899 of file EshelbianPlasticity.hpp.


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