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

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

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

Public Types

using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator
 

Public Member Functions

 OpFaceSideMaterialForce (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 928 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ OP

using EshelbianPlasticity::OpFaceSideMaterialForce::OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator

Definition at line 932 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpFaceSideMaterialForce()

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

Definition at line 934 of file EshelbianPlasticity.hpp.

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

Definition at line 3359 of file EshelbianOperators.cpp.

3360 {
3362
3368
3369 dataAtPts->faceMaterialForceAtPts.resize(3, getGaussPts().size2(), false);
3370 dataAtPts->normalPressureAtPts.resize(getGaussPts().size2(), false);
3371 if (getNinTheLoop() == 0) {
3372 dataAtPts->faceMaterialForceAtPts.clear();
3373 dataAtPts->normalPressureAtPts.clear();
3374 }
3375 auto loop_size = getLoopSize();
3376 if (loop_size == 1) {
3377 auto numebered_fe_ptr = getSidePtrFE()->numeredEntFiniteElementPtr;
3378 auto pstatus = numebered_fe_ptr->getPStatus();
3379 if (pstatus & (PSTATUS_SHARED | PSTATUS_MULTISHARED)) {
3380 loop_size = 2;
3381 }
3382 }
3383
3385
3386 auto t_normal = getFTensor1NormalsAtGaussPts();
3388 dataAtPts->faceMaterialForceAtPts); //< face material force
3389 auto t_p =
3390 getFTensor0FromVec(dataAtPts->normalPressureAtPts); //< normal pressure
3391 auto t_P = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->approxPAtPts);
3392 auto t_grad_u_gamma =
3394 auto t_strain =
3395 getFTensor2SymmetricFromMat<SPACE_DIM>(dataAtPts->logStretchTensorAtPts);
3396
3398 case GRIFFITH_FORCE:
3399 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3401 t_N(I) = t_normal(I);
3402 t_N.normalize();
3403
3405 t_grad_u(i, j) =
3406 (t_grad_u_gamma(i, j) - t_grad_u_gamma(j, i)) / 2. + t_strain(i, j);
3407 t_T(I) += t_N(J) * (t_grad_u(i, I) * t_P(i, J)) / loop_size;
3408 // note that works only for Hooke material,
3409 t_T(I) -= t_N(I) * ((t_strain(i, K) * t_P(i, K)) / 2) / loop_size;
3410
3411 t_p += t_N(I) *
3412 (t_N(J) * ((t_kd(i, I) + t_grad_u_gamma(i, I)) * t_P(i, J))) /
3413 loop_size;
3414
3415 ++t_normal;
3416 ++t_P;
3417 ++t_grad_u_gamma;
3418 ++t_strain;
3419 ++t_T;
3420 ++t_p;
3421 }
3422 break;
3423 case GRIFFITH_SKELETON:
3424 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3426 t_N(I) = t_normal(I);
3427 t_N.normalize();
3428
3429 t_T(I) += t_N(J) * (t_grad_u_gamma(i, I) * t_P(i, J)) / loop_size;
3430
3431 t_p += t_N(I) *
3432 (t_N(J) * ((t_kd(i, I) + t_grad_u_gamma(i, I)) * t_P(i, J))) /
3433 loop_size;
3434
3435 ++t_normal;
3436 ++t_P;
3437 ++t_grad_u_gamma;
3438 ++t_T;
3439 ++t_p;
3440 }
3441 break;
3442
3443 default:
3444 SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED,
3445 "Grffith energy release "
3446 "selector not implemented");
3447 };
3448
3449#ifndef NDEBUG
3450 auto side_fe_ptr = getSidePtrFE();
3451 auto side_fe_mi_ptr = side_fe_ptr->numeredEntFiniteElementPtr;
3452 auto pstatus = side_fe_mi_ptr->getPStatus();
3453 if (pstatus) {
3454 auto owner = side_fe_mi_ptr->getOwnerProc();
3455 MOFEM_LOG("SELF", Sev::noisy)
3456 << "OpFaceSideMaterialForce: owner proc is not 0, owner proc: " << owner
3457 << " " << getPtrFE()->mField.get_comm_rank() << " n in the loop "
3458 << getNinTheLoop() << " loop size " << getLoopSize();
3459 }
3460#endif // NDEBUG
3461
3463}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
Tensor1< T, Tensor_Dim > normalize()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto t_kd
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
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 getFTensor2SymmetricFromMat(ublas::matrix< T, L, A > &data)
Get symmetric tensor rank 2 (matrix) form data matrix.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
constexpr IntegrationType I
static enum EnergyReleaseSelector energyReleaseSelector
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Data Documentation

◆ dataAtPts

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

data at integration pts

Examples
EshelbianOperators.cpp.

Definition at line 941 of file EshelbianPlasticity.hpp.


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