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 &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_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)
 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
 
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
 
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 128 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 824 of file HMHHencky.cpp.

827 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
828 alphaU(alpha) {
829 sYmm = false;
830
831 CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULLPTR, "", "-poly_convex",
832 &polyConvex, PETSC_NULLPTR),
833 "get polyconvex option failed");
834}
#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 942 of file HMHHencky.cpp.

943 {
946 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
947 "Polyconvex Hencky with heterogeneous material properties is not "
948 "implemented");
949 }
950 if (polyConvex) {
951 CHKERR integratePolyconvexHencky(row_data, col_data);
952 } else {
953 CHKERR integrateHencky(row_data, col_data);
954 }
956}
#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 959 of file HMHHencky.cpp.

960 {
962
965 auto t_L = symm_L_tensor();
966 auto t_diff = diff_tensor();
967
968 int nb_integration_pts = row_data.getN().size1();
969 int row_nb_dofs = row_data.getIndices().size();
970 int col_nb_dofs = col_data.getIndices().size();
971
972 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
974 size_symm>(
975
976 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
977 &m(r + 0, c + 4), &m(r + 0, c + 5),
978
979 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
980 &m(r + 1, c + 4), &m(r + 1, c + 5),
981
982 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
983 &m(r + 2, c + 4), &m(r + 2, c + 5),
984
985 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
986 &m(r + 3, c + 4), &m(r + 3, c + 5),
987
988 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
989 &m(r + 4, c + 4), &m(r + 4, c + 5),
990
991 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
992 &m(r + 5, c + 4), &m(r + 5, c + 5)
993
994 );
995 };
996
997 FTENSOR_INDEXES(SPACE_DIM, i, j, k, l, m, n);
998
999 auto v = getVolume();
1000 auto t_w = getFTensor0IntegrationWeight();
1001
1002 auto t_approx_P_adjoint__dstretch =
1003 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1004 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1005 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1006
1007 int row_nb_base_functions = row_data.getN().size2();
1008 auto t_row_base_fun = row_data.getFTensor0N();
1009
1010 auto get_dP = [&]() {
1011 auto get_stress =
1012 MatrixSizeHelper<GetFTensor2FromMatType<size_symm, size_symm, -1, DL>,
1013 DL>::size(dP, nb_integration_pts);
1014 auto ts_a = getTSa();
1015
1016 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1018 if constexpr (!STRIDEMATD) {
1019 t_dP_tmp(L, J) = -(1 + alphaU * ts_a) *
1020 (t_L(i, j, L) * ((t_D(i, j, m, n) * t_diff(m, n, k, l)) *
1021 t_L(k, l, J)));
1022 }
1023 // allocate FTensors
1025 L_left(i, j, L) = t_L(i, j, L);
1027 L_right(k, l, J) = t_L(k, l, J);
1029
1032 auto t_approx_P_adjoint__dstretch =
1033 dataAtPts->getFTensorAdjointPdstretch(nb_integration_pts);
1034 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(nb_integration_pts);
1035 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(nb_integration_pts);
1036 auto &nbUniq = dataAtPts->nbUniq;
1037
1038 auto t_dP = get_stress();
1039 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1040 if constexpr (STRIDEMATD) {
1041 temp(i, j, k, l) = t_D(i, j, m, n) * t_diff(m, n, k, l);
1042
1043 t_dP_tmp(L, J) =
1044 -(1 + alphaU * ts_a) *
1045 (L_left(i, j, L) * (temp(i, j, k, l) * L_right(k, l, J)));
1046
1047 ++t_D;
1048 }
1049
1050 // Work of symmetric tensor on undefined tensor is equal to the work
1051 // of the symmetric part of it
1053 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
1054 t_approx_P_adjoint__dstretch(j, i));
1055 t_sym(i, j) /= 2.0;
1056 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1057 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1058 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
1059 t_dP(L, J) = t_L(i, j, L) *
1060 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
1061 t_L(k, l, J)) /
1062 2. +
1063 t_dP_tmp(L, J);
1064
1065 ++t_dP;
1066 ++t_approx_P_adjoint__dstretch;
1067 ++t_eigen_vals;
1068 ++t_eigen_vecs;
1069 }
1070 } else {
1071 auto t_dP = get_stress();
1072 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1073 if constexpr (STRIDEMATD) {
1074 temp(i, j, k, l) = t_D(i, j, m, n) * t_diff(m, n, k, l);
1075
1076 t_dP_tmp(L, J) =
1077 -(1 + alphaU * ts_a) *
1078 (L_left(i, j, L) * (temp(i, j, k, l) * L_right(k, l, J)));
1079
1080 ++t_D;
1081 }
1082 t_dP(L, J) = t_dP_tmp(L, J);
1083
1084 ++t_dP;
1085 }
1086 }
1087
1088 return get_stress();
1089 };
1090
1091 auto t_dP = get_dP();
1092
1093 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1094 double a = v * t_w;
1095
1096 int rr = 0;
1097 for (; rr != row_nb_dofs / 6; ++rr) {
1098 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1099 auto t_m = get_ftensor2(K, 6 * rr, 0);
1100 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1101 const double b = a * t_row_base_fun * t_col_base_fun;
1102 t_m(L, J) -= b * t_dP(L, J);
1103 ++t_m;
1104 ++t_col_base_fun;
1105 }
1106 ++t_row_base_fun;
1107 }
1108
1109 for (; rr != row_nb_base_functions; ++rr) {
1110 ++t_row_base_fun;
1111 }
1112
1113 ++t_w;
1114 ++t_dP;
1115 }
1117}
#define FTENSOR_INDEXES(DIM,...)
constexpr double a
constexpr int SPACE_DIM
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 1121 of file HMHHencky.cpp.

1122 {
1124
1127 auto t_L = symm_L_tensor();
1128 auto t_diff = diff_tensor();
1129
1130 int nb_integration_pts = row_data.getN().size1();
1131 int row_nb_dofs = row_data.getIndices().size();
1132 int col_nb_dofs = col_data.getIndices().size();
1133
1134 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
1136 size_symm>(
1137
1138 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1139 &m(r + 0, c + 4), &m(r + 0, c + 5),
1140
1141 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1142 &m(r + 1, c + 4), &m(r + 1, c + 5),
1143
1144 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1145 &m(r + 2, c + 4), &m(r + 2, c + 5),
1146
1147 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1148 &m(r + 3, c + 4), &m(r + 3, c + 5),
1149
1150 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1151 &m(r + 4, c + 4), &m(r + 4, c + 5),
1152
1153 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1154 &m(r + 5, c + 4), &m(r + 5, c + 5)
1155
1156 );
1157 };
1158 FTensor::Index<'i', 3> i;
1159 FTensor::Index<'j', 3> j;
1160 FTensor::Index<'k', 3> k;
1161 FTensor::Index<'l', 3> l;
1162 FTensor::Index<'m', 3> m;
1163 FTensor::Index<'n', 3> n;
1164
1165 auto v = getVolume();
1166 auto t_w = getFTensor0IntegrationWeight();
1167
1168 int row_nb_base_functions = row_data.getN().size2();
1169 auto t_row_base_fun = row_data.getFTensor0N();
1170
1171 auto get_dP = [&]() {
1172 auto get_stress =
1173 MatrixSizeHelper<GetFTensor2FromMatType<size_symm, size_symm, -1, DL>,
1174 DL>::size(dP, nb_integration_pts);
1175 auto ts_a = getTSa();
1176
1177 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
1178
1179 constexpr double nohat_k = 1. / 4;
1180 constexpr double hat_k = 1. / 8;
1181 double mu = dataAtPts->mu;
1182 double lambda = dataAtPts->lambda;
1183
1184 constexpr double third = boost::math::constants::third<double>();
1186 auto t_diff_deviator = diff_deviator(diff_tensor());
1187
1188 auto t_approx_P_adjoint__dstretch =
1189 dataAtPts->getFTensorAdjointPdstretch(getGaussPts().size2());
1190 auto t_log_stretch_h1 =
1191 dataAtPts->getFTensorLogStretchTotal(getGaussPts().size2());
1192 auto t_eigen_vals = dataAtPts->getFTensorEigenVals(getGaussPts().size2());
1193 auto t_eigen_vecs = dataAtPts->getFTensorEigenVecs(getGaussPts().size2());
1194 auto &nbUniq = dataAtPts->nbUniq;
1195
1196 auto t_dP = get_stress();
1197 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1198
1199 double log_det = t_log_stretch_h1(i, i);
1200 double log_det2 = log_det * log_det;
1202 t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
1203 double dev_norm2 = t_dev(i, j) * t_dev(i, j);
1204
1205 auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
1206 auto B = lambda * std::exp(hat_k * log_det2) * log_det;
1207
1208 FTensor::Tensor2_symmetric<double, 3> t_A_diff, t_B_diff;
1209 t_A_diff(i, j) =
1210 (A * 2 * nohat_k) * (t_dev(k, l) * t_diff_deviator(k, l, i, j));
1211 t_B_diff(i, j) = (B * 2 * hat_k) * log_det * t_kd(i, j) +
1212 lambda * std::exp(hat_k * log_det2) * t_kd(i, j);
1214 t_dT(i, j, k, l) =
1215 t_A_diff(i, j) * (t_dev(m, n) * t_diff_deviator(m, n, k, l))
1216
1217 +
1218
1219 A * t_diff_deviator(m, n, i, j) * t_diff_deviator(m, n, k, l)
1220
1221 +
1222
1223 t_B_diff(i, j) * t_kd(k, l);
1224
1225 t_dP(L, J) = -t_L(i, j, L) *
1226 ((
1227
1228 t_dT(i, j, k, l)
1229
1230 +
1231
1232 (alphaU * ts_a) * (t_D(i, j, m, n) * t_diff(m, n, k, l)
1233
1234 )) *
1235 t_L(k, l, J));
1236
1237 // Work of symmetric tensor on undefined tensor is equal to the work
1238 // of the symmetric part of it
1242 t_sym(i, j) = (t_approx_P_adjoint__dstretch(i, j) ||
1243 t_approx_P_adjoint__dstretch(j, i));
1244 t_sym(i, j) /= 2.0;
1245 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1246 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1247 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
1248 t_dP(L, J) += t_L(i, j, L) *
1249 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) *
1250 t_L(k, l, J)) /
1251 2.;
1252 }
1253
1254 ++t_dP;
1255 ++t_approx_P_adjoint__dstretch;
1256 ++t_log_stretch_h1;
1257 ++t_eigen_vals;
1258 ++t_eigen_vecs;
1259 }
1260
1261 return get_stress();
1262 };
1263
1264 auto t_dP = get_dP();
1265 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1266 double a = v * t_w;
1267
1268 int rr = 0;
1269 for (; rr != row_nb_dofs / 6; ++rr) {
1270 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1271 auto t_m = get_ftensor2(K, 6 * rr, 0);
1272 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1273 const double b = a * t_row_base_fun * t_col_base_fun;
1274 t_m(L, J) -= b * t_dP(L, J);
1275 ++t_m;
1276 ++t_col_base_fun;
1277 }
1278 ++t_row_base_fun;
1279 }
1280
1281 for (; rr != row_nb_base_functions; ++rr) {
1282 ++t_row_base_fun;
1283 }
1284
1285 ++t_w;
1286 ++t_dP;
1287 }
1289}
constexpr double third
Kronecker Delta class symmetric.
constexpr auto t_kd
static double lambda
auto diff_deviator(FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
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 129 of file HMHHencky.cpp.

◆ dP

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

Definition at line 141 of file HMHHencky.cpp.

◆ polyConvex

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

Definition at line 139 of file HMHHencky.cpp.


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