v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD > Struct Template Reference
Inheritance diagram for EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >:
[legend]

Public Member Functions

 OpSpatialPhysical_du_du (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
 
MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
MoFEMErrorCode integrateHencky (EntData &row_data, EntData &col_data)
 
MoFEMErrorCode integratePolyconvexHencky (EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from 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 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 &)
 
virtual MoFEMErrorCode integrate (int, EntityType, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &, EntData &)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int, EntityType, 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 EntityHandle * getConn ()
 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)
 Constructor for operators working on finite element spaces.
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 Constructor for operators working on a single field.
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 Constructor for operators working on two fields (bilinear forms)
 
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
 
KspMethod::KSPContext getKSPCtx () const
 
SnesMethod::SNESContext getSNESCtx () 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
 
MoFEM::InterfacegetMField ()
 
moab::Interface & getMoab ()
 
virtual boost::weak_ptr< ForcesAndSourcesCoregetSubPipelinePtr () const
 
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
 

Public Attributes

const double alphaU
 
- Public Attributes inherited from 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
 

Private Attributes

PetscBool polyConvex = PETSC_FALSE
 
MatrixDouble dP
 

Additional Inherited Members

- Public Types inherited from OpAssembleVolume
using OP = OpAssembleBasic< VolUserDataOperator >
 
using ScaleOff = typename OP::ScaleOff
 
- Public Types inherited from OpAssembleBasic< VolUserDataOperator >
using ScaleOff = boost::function< double()>
 
- 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 = std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > > >
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 
- 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 Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 
- Static Protected Attributes inherited from OpAssembleVolume
static std::map< std::pair< std::string, std::string >, MatrixDouble > mapMatrix
 

Detailed Description

template<int STRIDEMATD = 0>
struct EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >

Definition at line 175 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical_du_du()

template<int STRIDEMATD = 0>
EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::OpSpatialPhysical_du_du ( std::string  row_field,
std::string  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha 
)

Definition at line 901 of file HMHHencky.cpp.

904 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
905 alphaU(alpha) {
906 sYmm = false;
907
908 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR, "", "-poly_convex",
909 &polyConvex, PETSC_NULLPTR),
910 "get polyconvex option failed");
911}
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
bool sYmm
If true assume that matrix is symmetric structure.
@ OPROWCOL
operator doWork is executed on FE rows &columns

Member Function Documentation

◆ integrate()

template<int STRIDEMATD = 0>
MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::integrate ( EntData row_data,
EntData col_data 
)

Definition at line 1019 of file HMHHencky.cpp.

1020 {
1023 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1024 "Polyconvex Hencky with heterogeneous material properties is not "
1025 "implemented");
1026 }
1027 if (polyConvex) {
1028 CHKERR integratePolyconvexHencky(row_data, col_data);
1029 } else {
1030 CHKERR integrateHencky(row_data, col_data);
1031 }
1033}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
static bool hasNonHomogeneousMaterialBlock
MoFEMErrorCode integratePolyconvexHencky(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data)

◆ integrateHencky()

template<int STRIDEMATD = 0>
MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::integrateHencky ( EntData row_data,
EntData col_data 
)

Definition at line 1036 of file HMHHencky.cpp.

1037 {
1039
1043 auto t_diff = FTensor::DiffTensor<double>();
1044
1045 int nb_integration_pts = row_data.getN().size1();
1046 int row_nb_dofs = row_data.getIndices().size();
1047 int col_nb_dofs = col_data.getIndices().size();
1048
1049 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
1051 size_symm>(
1052
1053 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1054 &m(r + 0, c + 4), &m(r + 0, c + 5),
1055
1056 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1057 &m(r + 1, c + 4), &m(r + 1, c + 5),
1058
1059 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1060 &m(r + 2, c + 4), &m(r + 2, c + 5),
1061
1062 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1063 &m(r + 3, c + 4), &m(r + 3, c + 5),
1064
1065 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1066 &m(r + 4, c + 4), &m(r + 4, c + 5),
1067
1068 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1069 &m(r + 5, c + 4), &m(r + 5, c + 5)
1070
1071 );
1072 };
1073
1074 FTENSOR_INDEXES(SPACE_DIM, i, j, k, l, m, n);
1075
1076 auto v = getVolume();
1077 auto t_w = getFTensor0IntegrationWeight();
1078
1079 auto t_approx_P_adjoint__dstretch =
1080 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1081 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1082 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1083
1084 int row_nb_base_functions = row_data.getN().size2();
1085 auto t_row_base_fun = row_data.getFTensor0N();
1086
1087 auto get_dP = [&]() {
1088 auto get_stress =
1089 MatrixSizeHelper<GetFTensor2FromMatType<size_symm, size_symm, -1, DL>,
1090 DL>::size(dP, nb_integration_pts);
1091 auto ts_a = getTSa();
1092
1093 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1095 if constexpr (!STRIDEMATD) {
1096 t_dP_tmp(L, J) = -(1 + alphaU * ts_a) *
1097 (t_L(i, j, L) * ((t_D(i, j, m, n) * t_diff(m, n, k, l)) *
1098 t_L(k, l, J)));
1099 }
1100 // allocate FTensors
1102 L_left(i, j, L) = t_L(i, j, L);
1104 L_right(k, l, J) = t_L(k, l, J);
1106
1109 auto t_approx_P_adjoint__dstretch =
1110 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1111 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1112 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1113 auto &nbUniq = dataAtPts->nbUniq;
1114
1115 auto t_dP = get_stress();
1116 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1117 if constexpr (STRIDEMATD) {
1118 temp(i, j, k, l) = t_D(i, j, m, n) * t_diff(m, n, k, l);
1119
1120 t_dP_tmp(L, J) =
1121 -(1 + alphaU * ts_a) *
1122 (L_left(i, j, L) * (temp(i, j, k, l) * L_right(k, l, J)));
1123
1124 ++t_D;
1125 }
1126
1127 // Work of symmetric tensor on undefined tensor is equal to the work
1128 // of the symmetric part of it
1130 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
1131 t_approx_P_adjoint__dstretch(j, i));
1132 t_sym(i, j) /= 2.0;
1133 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1134 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1135 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
1136 t_dP(L, J) = t_L(i, j, L) *
1137 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
1138 t_L(k, l, J)) /
1139 2. +
1140 t_dP_tmp(L, J);
1141
1142 ++t_dP;
1143 ++t_approx_P_adjoint__dstretch;
1144 ++t_eigen_vals;
1145 ++t_eigen_vecs;
1146 }
1147 } else {
1148 auto t_dP = get_stress();
1149 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1150 if constexpr (STRIDEMATD) {
1151 temp(i, j, k, l) = t_D(i, j, m, n) * t_diff(m, n, k, l);
1152
1153 t_dP_tmp(L, J) =
1154 -(1 + alphaU * ts_a) *
1155 (L_left(i, j, L) * (temp(i, j, k, l) * L_right(k, l, J)));
1156
1157 ++t_D;
1158 }
1159 t_dP(L, J) = t_dP_tmp(L, J);
1160
1161 ++t_dP;
1162 }
1163 }
1164
1165 return get_stress();
1166 };
1167
1168 auto t_dP = get_dP();
1169
1170 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1171 double a = v * t_w;
1172
1173 int rr = 0;
1174 for (; rr != row_nb_dofs / 6; ++rr) {
1175 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1176 auto t_m = get_ftensor2(K, 6 * rr, 0);
1177 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1178 const double b = a * t_row_base_fun * t_col_base_fun;
1179 t_m(L, J) -= b * t_dP(L, J);
1180 ++t_m;
1181 ++t_col_base_fun;
1182 }
1183 ++t_row_base_fun;
1184 }
1185
1186 for (; rr != row_nb_base_functions; ++rr) {
1187 ++t_row_base_fun;
1188 }
1189
1190 ++t_w;
1191 ++t_dP;
1192 }
1194}
#define FTENSOR_INDEXES(DIM,...)
constexpr double a
constexpr int SPACE_DIM
Fourth-order differential tensor symmetric in both index pairs.
Mapping from symmetric tensor indices to packed storage index.
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto getDiffDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, C &&t_S, const int nb)
Get the Diff Diff Mat object.
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
static constexpr auto size_symm
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
int r
Definition sdf.py:205
FTensor::Index< 'm', 3 > m
void temp(int x, int y=10)
Definition simple.cpp:4
static enum StretchSelector stretchSelector
static enum RotSelector gradApproximator
static boost::function< double(const double)> f
static boost::function< double(const double)> dd_f
static boost::function< double(const double)> d_f
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 degrees of freedom on entity.
auto getFTensor0IntegrationWeight()
Get integration weights.
MatrixDouble K
local tangent matrix
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

◆ integratePolyconvexHencky()

template<int STRIDEMATD = 0>
MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::integratePolyconvexHencky ( EntData row_data,
EntData col_data 
)

Definition at line 1198 of file HMHHencky.cpp.

1199 {
1201
1205 auto t_diff = FTensor::DiffTensor<double>();
1206
1207 int nb_integration_pts = row_data.getN().size1();
1208 int row_nb_dofs = row_data.getIndices().size();
1209 int col_nb_dofs = col_data.getIndices().size();
1210
1211 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
1213 size_symm>(
1214
1215 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1216 &m(r + 0, c + 4), &m(r + 0, c + 5),
1217
1218 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1219 &m(r + 1, c + 4), &m(r + 1, c + 5),
1220
1221 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1222 &m(r + 2, c + 4), &m(r + 2, c + 5),
1223
1224 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1225 &m(r + 3, c + 4), &m(r + 3, c + 5),
1226
1227 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1228 &m(r + 4, c + 4), &m(r + 4, c + 5),
1229
1230 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1231 &m(r + 5, c + 4), &m(r + 5, c + 5)
1232
1233 );
1234 };
1235 FTensor::Index<'i', 3> i;
1236 FTensor::Index<'j', 3> j;
1237 FTensor::Index<'k', 3> k;
1238 FTensor::Index<'l', 3> l;
1239 FTensor::Index<'m', 3> m;
1240 FTensor::Index<'n', 3> n;
1241
1242 auto v = getVolume();
1243 auto t_w = getFTensor0IntegrationWeight();
1244
1245 int row_nb_base_functions = row_data.getN().size2();
1246 auto t_row_base_fun = row_data.getFTensor0N();
1247
1248 auto get_dP = [&]() {
1249 auto get_stress =
1250 MatrixSizeHelper<GetFTensor2FromMatType<size_symm, size_symm, -1, DL>,
1251 DL>::size(dP, nb_integration_pts);
1252 auto ts_a = getTSa();
1253
1254 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
1255
1256 constexpr double nohat_k = 1. / 4;
1257 constexpr double hat_k = 1. / 8;
1258 double mu = dataAtPts->mu;
1259 double lambda = dataAtPts->lambda;
1260
1261 constexpr double third = boost::math::constants::third<double>();
1263 auto t_diff_deviator = FTensor::DiffDeviator<double, 3>();
1264
1265 auto t_approx_P_adjoint__dstretch =
1266 dataAtPts->getFTensorAdjointPdstretch(getGaussPts().size2());
1267 auto t_log_stretch_h1 =
1268 dataAtPts->getFTensorLogStretchTotal(getGaussPts().size2());
1269 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(getGaussPts().size2());
1270 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(getGaussPts().size2());
1271 auto &nbUniq = dataAtPts->nbUniq;
1272
1273 auto t_dP = get_stress();
1274 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1275
1276 double log_det = t_log_stretch_h1(i, i);
1277 double log_det2 = log_det * log_det;
1279 t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
1280 double dev_norm2 = t_dev(i, j) * t_dev(i, j);
1281
1282 auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
1283 auto B = lambda * std::exp(hat_k * log_det2) * log_det;
1284
1285 FTensor::Tensor2_symmetric<double, 3> t_A_diff, t_B_diff;
1286 t_A_diff(i, j) =
1287 (A * 2 * nohat_k) * (t_dev(k, l) * t_diff_deviator(k, l, i, j));
1288 t_B_diff(i, j) = (B * 2 * hat_k) * log_det * t_kd(i, j) +
1289 lambda * std::exp(hat_k * log_det2) * t_kd(i, j);
1291 t_dT(i, j, k, l) =
1292 t_A_diff(i, j) * (t_dev(m, n) * t_diff_deviator(m, n, k, l))
1293
1294 +
1295
1296 A * t_diff_deviator(m, n, i, j) * t_diff_deviator(m, n, k, l)
1297
1298 +
1299
1300 t_B_diff(i, j) * t_kd(k, l);
1301
1302 t_dP(L, J) = -t_L(i, j, L) *
1303 ((
1304
1305 t_dT(i, j, k, l)
1306
1307 +
1308
1309 (alphaU * ts_a) * (t_D(i, j, m, n) * t_diff(m, n, k, l)
1310
1311 )) *
1312 t_L(k, l, J));
1313
1314 // Work of symmetric tensor on undefined tensor is equal to the work
1315 // of the symmetric part of it
1319 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
1320 t_approx_P_adjoint__dstretch(j, i));
1321 t_sym(i, j) /= 2.0;
1322 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1323 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1324 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
1325 t_dP(L, J) += t_L(i, j, L) *
1326 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
1327 t_L(k, l, J)) /
1328 2.;
1329 }
1330
1331 ++t_dP;
1332 ++t_approx_P_adjoint__dstretch;
1333 ++t_log_stretch_h1;
1334 ++t_eigen_vals;
1335 ++t_eigen_vecs;
1336 }
1337
1338 return get_stress();
1339 };
1340
1341 auto t_dP = get_dP();
1342 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1343 double a = v * t_w;
1344
1345 int rr = 0;
1346 for (; rr != row_nb_dofs / 6; ++rr) {
1347 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1348 auto t_m = get_ftensor2(K, 6 * rr, 0);
1349 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1350 const double b = a * t_row_base_fun * t_col_base_fun;
1351 t_m(L, J) -= b * t_dP(L, J);
1352 ++t_m;
1353 ++t_col_base_fun;
1354 }
1355 ++t_row_base_fun;
1356 }
1357
1358 for (; rr != row_nb_base_functions; ++rr) {
1359 ++t_row_base_fun;
1360 }
1361
1362 ++t_w;
1363 ++t_dP;
1364 }
1366}
constexpr double third
Fourth-order differential deviator tensor.
Kronecker Delta class symmetric.
constexpr auto t_kd
static double lambda
constexpr AssemblyType A
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element

Member Data Documentation

◆ alphaU

template<int STRIDEMATD = 0>
const double EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::alphaU

Definition at line 176 of file HMHHencky.cpp.

◆ dP

template<int STRIDEMATD = 0>
MatrixDouble EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::dP
private

Definition at line 188 of file HMHHencky.cpp.

◆ polyConvex

template<int STRIDEMATD = 0>
PetscBool EshelbianPlasticity::HMHHencky::OpSpatialPhysical_du_du< STRIDEMATD >::polyConvex = PETSC_FALSE
private

Definition at line 186 of file HMHHencky.cpp.


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