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

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

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

Public Member Functions

 OpSpatialRotation_domega_du (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, double alpha_omega)
 
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 765 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialRotation_domega_du()

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

Definition at line 766 of file EshelbianPlasticity.hpp.

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Examples
EshelbianOperators.cpp.

Definition at line 2543 of file EshelbianOperators.cpp.

2544 {
2546 int nb_integration_pts = getGaussPts().size2();
2547 int row_nb_dofs = row_data.getIndices().size();
2548 int col_nb_dofs = col_data.getIndices().size();
2549 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
2551 size_symm>{
2552
2553 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
2554 &m(r + 0, c + 4), &m(r + 0, c + 5),
2555
2556 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
2557 &m(r + 1, c + 4), &m(r + 1, c + 5),
2558
2559 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
2560 &m(r + 2, c + 4), &m(r + 2, c + 5)
2561
2562 };
2563 };
2564
2567
2568 auto v = getVolume();
2569 auto t_w = getFTensor0IntegrationWeight();
2570 auto t_levi_kirchhoff_du = getFTensor2FromMat<3, size_symm>(
2571 dataAtPts->leviKirchhoffdLogStreatchAtPts);
2572 int row_nb_base_functions = row_data.getN().size2();
2573 auto t_row_base_fun = row_data.getFTensor0N();
2574 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2575 double a = v * t_w;
2576 int rr = 0;
2577 for (; rr != row_nb_dofs / 3; ++rr) {
2578 auto t_m = get_ftensor2(K, 3 * rr, 0);
2579 const double b = a * t_row_base_fun;
2580 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
2581 for (int cc = 0; cc != col_nb_dofs / size_symm; ++cc) {
2582 t_m(k, L) -= (b * t_col_base_fun) * t_levi_kirchhoff_du(k, L);
2583 ++t_m;
2584 ++t_col_base_fun;
2585 }
2586 ++t_row_base_fun;
2587 }
2588 for (; rr != row_nb_base_functions; ++rr) {
2589 ++t_row_base_fun;
2590 }
2591 ++t_w;
2592 ++t_levi_kirchhoff_du;
2593 }
2595}
#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()
const double c
speed of light (cm/ns)
FTensor::Index< 'k', 3 > k
static constexpr auto size_symm
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) 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....
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: