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

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

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

Public Member Functions

 OpSpatialConsistency_dP_dP (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
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
 

Private Member Functions

template<int S>
MoFEMErrorCode integrateImpl (EntData &row_data, EntData &col_data)
 

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 813 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialConsistency_dP_dP()

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

Definition at line 814 of file EshelbianPlasticity.hpp.

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Examples
EshelbianOperators.cpp.

Definition at line 2769 of file EshelbianOperators.cpp.

2770 {
2772 if (dataAtPts->matInvD.size1() == size_symm &&
2773 dataAtPts->matInvD.size2() == size_symm) {
2774 MoFEMFunctionReturnHot(integrateImpl<0>(row_data, col_data));
2775 } else {
2777 }
2779};
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static constexpr auto size_symm
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)

◆ integrateImpl()

template<int S>
MoFEMErrorCode OpSpatialConsistency_dP_dP::integrateImpl ( EntData & row_data,
EntData & col_data )
private
Examples
EshelbianOperators.cpp.

Definition at line 2782 of file EshelbianOperators.cpp.

2783 {
2785
2786 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
2788
2789 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2),
2790
2791 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2),
2792
2793 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2)
2794
2795 );
2796 };
2797
2798 int nb_integration_pts = getGaussPts().size2();
2799 int row_nb_dofs = row_data.getIndices().size();
2800 int col_nb_dofs = col_data.getIndices().size();
2801
2802 auto v = getVolume();
2803 auto t_w = getFTensor0IntegrationWeight();
2804 int row_nb_base_functions = row_data.getN().size2() / 3;
2805
2810
2812 &*dataAtPts->matInvD.data().begin());
2813
2814 auto t_row_base = row_data.getFTensor1N<3>();
2815 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2816 double a = v * t_w;
2817
2818 int rr = 0;
2819 for (; rr != row_nb_dofs / 3; ++rr) {
2820 auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
2821 auto t_m = get_ftensor2(K, 3 * rr, 0);
2822 for (int cc = 0; cc != col_nb_dofs / 3; ++cc) {
2823 t_m(i, k) -= a * t_row_base(j) * (t_inv_D(i, j, k, l) * t_col_base(l));
2824 ++t_m;
2825 ++t_col_base;
2826 }
2827
2828 ++t_row_base;
2829 }
2830
2831 for (; rr != row_nb_base_functions; ++rr)
2832 ++t_row_base;
2833
2834 ++t_w;
2835 ++t_inv_D;
2836 }
2838}
#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)
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto getFTensor4DdgFromPtr(T *ptr)
int r
Definition sdf.py:8
FTensor::Index< 'm', 3 > m
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
auto getFTensor0IntegrationWeight()
Get integration weights.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element

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