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

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

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

Public Member Functions

 OpSpatialRotation_domega_dBubble (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 787 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialRotation_domega_dBubble()

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

Definition at line 788 of file EshelbianPlasticity.hpp.

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Examples
EshelbianOperators.cpp.

Definition at line 2655 of file EshelbianOperators.cpp.

2656 {
2658 int nb_integration_pts = getGaussPts().size2();
2659 int row_nb_dofs = row_data.getIndices().size();
2660 int col_nb_dofs = col_data.getIndices().size();
2661
2662 auto get_ftensor1 = [](MatrixDouble &m, const int r, const int c) {
2664 &m(r + 0, c), &m(r + 1, c), &m(r + 2, c));
2665 };
2666
2667 FTENSOR_INDEX(3, i);
2668 FTENSOR_INDEX(3, k);
2669 FTENSOR_INDEX(3, m);
2670
2671 auto v = getVolume();
2672 auto t_w = getFTensor0IntegrationWeight();
2673 auto t_levi_kirchoff_dP =
2674 getFTensor3FromMat<3, 3, 3>(dataAtPts->leviKirchhoffPAtPts);
2675
2676 int row_nb_base_functions = row_data.getN().size2();
2677 auto t_row_base_fun = row_data.getFTensor0N();
2678
2679 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2680 double a = v * t_w;
2681 int rr = 0;
2682 for (; rr != row_nb_dofs / 3; ++rr) {
2683 double b = a * t_row_base_fun;
2684 auto t_col_base_fun = col_data.getFTensor2N<3, 3>(gg, 0);
2685 auto t_m = get_ftensor1(K, 3 * rr, 0);
2686 for (int cc = 0; cc != col_nb_dofs; ++cc) {
2687 t_m(m) -= b * (t_levi_kirchoff_dP(m, i, k) * t_col_base_fun(i, k));
2688 ++t_m;
2689 ++t_col_base_fun;
2690 }
2691 ++t_row_base_fun;
2692 }
2693
2694 for (; rr != row_nb_base_functions; ++rr) {
2695 ++t_row_base_fun;
2696 }
2697 ++t_w;
2698 ++t_levi_kirchoff_dP;
2699 }
2701}
#define FTENSOR_INDEX(DIM, I)
constexpr double a
#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< '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.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element

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