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

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

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

Public Member Functions

 OpSpatialPrj (std::string row_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode integrate (EntData &row_data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleVolume
MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
 OpAssembleBasic (const FieldSpace space)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
int getNumNodes ()
 get element number of nodes
 
const EntityHandlegetConn ()
 get element connectivity
 
double getVolume () const
 element volume (linear geometry)
 
doublegetVolume ()
 element volume (linear geometry)
 
FTensor::Tensor2< double *, 3, 3 > & getJac ()
 get element Jacobian
 
FTensor::Tensor2< double *, 3, 3 > & getInvJac ()
 get element inverse Jacobian
 
VectorDoublegetCoords ()
 nodal coordinates
 
VolumeElementForcesAndSourcesCoregetVolumeFE () const
 return pointer to Generic Volume Finite Element object
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement.
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle.
 
int getFEDim () const
 Get dimension of finite element.
 
EntityType getFEType () const
 Get dimension of finite element.
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer.
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity.
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element.
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices.
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices.
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object.
 
int getOpType () const
 Get operator types.
 
void setOpType (const OpType type)
 Set operator type.
 
void addOpType (const OpType type)
 Add operator type.
 
int getNinTheLoop () const
 get number of finite element in the loop
 
int getLoopSize () const
 get size of elements in the loop
 
std::string getFEName () const
 Get name of the element.
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element
 
auto getFTensor0IntegrationWeight ()
 Get integration weights.
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3)
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry.
 
double getMeasure () const
 get measure of element
 
doublegetMeasure ()
 get measure of element
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, boost::shared_ptr< Range > fe_range=nullptr, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy, AdjCache *adj_cache=nullptr)
 User calls this function to loop over elements on the side of face. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *this_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over the same element using a different set of integration points. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopRange (const string &fe_name, ForcesAndSourcesCore *range_fe, boost::shared_ptr< Range > fe_range, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 Iterate over range of elements.
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleVolume
using OP = OpAssembleBasic<VolUserDataOperator>
 
- Public Types inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
using ScaleOff
 
- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
using AdjCache
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType
 
using DoWorkRhsHookFunType
 
- Public Attributes inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 
VectorDouble nF
 local right hand side vector
 
MatrixDouble K
 local tangent matrix
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
booldoVertices
 \deprectaed If false skip vertices
 
booldoEdges
 \deprectaed If false skip edges
 
booldoQuads
 \deprectaed
 
booldoTris
 \deprectaed
 
booldoTets
 \deprectaed
 
booldoPrisms
 \deprectaed
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
- Protected Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 
- Static Protected Attributes inherited from EshelbianPlasticity::OpAssembleVolume
static std::map< std::pair< std::string, std::string >, MatrixDouble > mapMatrix
 

Detailed Description

Definition at line 902 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialPrj()

EshelbianPlasticity::OpSpatialPrj::OpSpatialPrj ( std::string row_field,
boost::shared_ptr< DataAtIntegrationPts > data_ptr )
inline

Definition at line 903 of file EshelbianPlasticity.hpp.

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

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPrj::integrate ( EntData & row_data)
virtual

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