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

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

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

Public Member Functions

 OpSpatialConsistency_dBubble_domega (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
 
MoFEMErrorCode integrate (EntData &row_data, EntData &col_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 (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &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 867 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialConsistency_dBubble_domega()

EshelbianPlasticity::OpSpatialConsistency_dBubble_domega::OpSpatialConsistency_dBubble_domega ( std::string row_field,
std::string col_field,
boost::shared_ptr< DataAtIntegrationPts > data_ptr,
const bool assemble_off )
inline

Definition at line 868 of file EshelbianPlasticity.hpp.

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

◆ integrate()

MoFEMErrorCode OpSpatialConsistency_dBubble_domega::integrate ( EntData & row_data,
EntData & col_data )
virtual

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Examples
EshelbianOperators.cpp.

Definition at line 3032 of file EshelbianOperators.cpp.

3033 {
3035
3042
3043 int nb_integration_pts = row_data.getN().size1();
3044 int row_nb_dofs = row_data.getIndices().size();
3045 int col_nb_dofs = col_data.getIndices().size();
3046
3047 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
3049 &m(r, c + 0), &m(r, c + 1), &m(r, c + 2));
3050 };
3051
3052 auto v = getVolume();
3053 auto t_w = getFTensor0IntegrationWeight();
3054 int row_nb_base_functions = row_data.getN().size2() / 9;
3055 auto t_row_base_fun = row_data.getFTensor2N<3, 3>();
3056
3057 auto t_h_domega = getFTensor3FromMat<3, 3, 3>(dataAtPts->hdOmegaAtPts);
3058 for (int gg = 0; gg != nb_integration_pts; ++gg) {
3059 double a = v * t_w;
3060
3061 int rr = 0;
3062 for (; rr != row_nb_dofs; ++rr) {
3063
3065 t_PRT(k) = t_row_base_fun(i, j) * t_h_domega(i, j, k);
3066
3067 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
3068 auto t_m = get_ftensor2(K, rr, 0);
3069 for (int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3070 t_m(j) -= (a * t_col_base_fun) * t_PRT(j);
3071 ++t_m;
3072 ++t_col_base_fun;
3073 }
3074
3075 ++t_row_base_fun;
3076 }
3077
3078 for (; rr != row_nb_base_functions; ++rr)
3079 ++t_row_base_fun;
3080
3081 ++t_w;
3082 ++t_h_domega;
3083 }
3085}
#define FTENSOR_INDEX(DIM, I)
constexpr double a
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static FTensor::Tensor3< FTensor::PackPtr< T *, 1 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 3 (non symmetries) form data matrix.
int r
Definition sdf.py:8
FTensor::Index< 'm', 3 > m
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.
auto getFTensor0IntegrationWeight()
Get integration weights.

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