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

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

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

Public Member Functions

 OpSpatialRotation_domega_dP (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 776 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialRotation_domega_dP()

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

Definition at line 777 of file EshelbianPlasticity.hpp.

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Examples
EshelbianOperators.cpp.

Definition at line 2597 of file EshelbianOperators.cpp.

2598 {
2600
2607
2608 int nb_integration_pts = getGaussPts().size2();
2609 int row_nb_dofs = row_data.getIndices().size();
2610 int col_nb_dofs = col_data.getIndices().size();
2611 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
2613
2614 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2),
2615
2616 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2),
2617
2618 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2)
2619
2620 );
2621 };
2622
2623 auto v = getVolume();
2624 auto t_w = getFTensor0IntegrationWeight();
2625
2626 int row_nb_base_functions = row_data.getN().size2();
2627 auto t_row_base_fun = row_data.getFTensor0N();
2628 auto t_levi_kirchhoff_dP =
2629 getFTensor3FromMat<3, 3, 3>(dataAtPts->leviKirchhoffPAtPts);
2630
2631 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2632 double a = v * t_w;
2633 int rr = 0;
2634 for (; rr != row_nb_dofs / 3; ++rr) {
2635 double b = a * t_row_base_fun;
2636 auto t_col_base_fun = col_data.getFTensor1N<3>(gg, 0);
2637 auto t_m = get_ftensor2(K, 3 * rr, 0);
2638 for (int cc = 0; cc != col_nb_dofs / 3; ++cc) {
2639 t_m(m, i) -= b * (t_levi_kirchhoff_dP(m, i, k) * t_col_base_fun(k));
2640 ++t_m;
2641 ++t_col_base_fun;
2642 }
2643 ++t_row_base_fun;
2644 }
2645 for (; rr != row_nb_base_functions; ++rr) {
2646 ++t_row_base_fun;
2647 }
2648
2649 ++t_w;
2650 ++t_levi_kirchhoff_dP;
2651 }
2653}
#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 constexpr auto size_symm
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::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....
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: