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

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

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

Public Types

using OP = FaceElementForcesAndSourcesCore::UserDataOperator
 

Public Member Functions

 OpFaceMaterialForce (boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 

Detailed Description

Definition at line 944 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ OP

using EshelbianPlasticity::OpFaceMaterialForce::OP = FaceElementForcesAndSourcesCore::UserDataOperator

Definition at line 948 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpFaceMaterialForce()

EshelbianPlasticity::OpFaceMaterialForce::OpFaceMaterialForce ( boost::shared_ptr< DataAtIntegrationPts > data_ptr)
inline

Definition at line 950 of file EshelbianPlasticity.hpp.

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

Definition at line 3465 of file EshelbianOperators.cpp.

3466 {
3468
3469#ifndef NDEBUG
3470 auto fe_mi_ptr = getFEMethod()->numeredEntFiniteElementPtr;
3471 auto pstatus = fe_mi_ptr->getPStatus();
3472 if (pstatus) {
3473 auto owner = fe_mi_ptr->getOwnerProc();
3474 MOFEM_LOG("SELF", Sev::noisy)
3475 << "OpFaceMaterialForce: owner proc is not 0, owner proc: " << owner
3476 << " " << getPtrFE()->mField.get_comm_rank();
3477 }
3478#endif // NDEBUG
3479
3481
3483 t_face_T(I) = 0.;
3484 double face_pressure = 0.;
3486 dataAtPts->faceMaterialForceAtPts); //< face material force
3487 auto t_p =
3488 getFTensor0FromVec(dataAtPts->normalPressureAtPts); //< normal pressure
3489 auto t_w = getFTensor0IntegrationWeight();
3490 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3491 t_face_T(I) += t_w * t_T(I);
3492 face_pressure += t_w * t_p;
3493 ++t_w;
3494 ++t_T;
3495 ++t_p;
3496 }
3497 t_face_T(I) *= getMeasure();
3498 face_pressure *= getMeasure();
3499
3500 auto get_tag = [&](auto name, auto dim) {
3501 auto &moab = getPtrFE()->mField.get_moab();
3502 Tag tag;
3503 double def_val[] = {0., 0., 0.};
3504 CHK_MOAB_THROW(moab.tag_get_handle(name, dim, MB_TYPE_DOUBLE, tag,
3505 MB_TAG_CREAT | MB_TAG_SPARSE, def_val),
3506 "create tag");
3507 return tag;
3508 };
3509
3510 auto set_tag = [&](auto &&tag, auto ptr) {
3511 auto &moab = getPtrFE()->mField.get_moab();
3512 auto face = getPtrFE()->getFEEntityHandle();
3513 CHK_MOAB_THROW(moab.tag_set_data(tag, &face, 1, ptr), "set tag");
3514 };
3515
3516 set_tag(get_tag("MaterialForce", 3), &t_face_T(0));
3517 set_tag(get_tag("FacePressure", 1), &face_pressure);
3518
3520}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
#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 MOFEM_LOG(channel, severity)
Log.
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
constexpr IntegrationType I
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpFaceMaterialForce::dataAtPts
private

data at integration pts

Examples
EshelbianOperators.cpp.

Definition at line 957 of file EshelbianPlasticity.hpp.


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