v0.15.5
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpCalculateEnergy Struct Reference

Calculate energy density for Hencky material model. More...

Inheritance diagram for EshelbianPlasticity::HMHHencky::OpCalculateEnergy:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpCalculateEnergy:
[legend]

Public Member Functions

 OpCalculateEnergy (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
boost::shared_ptr< doubletotalEnergyPtr
 

Detailed Description

Calculate energy density for Hencky material model.

\[ \Psi(\log{\mathbf{U}}) = \frac{1}{2} U_{IJ} D_{IJKL} U_{KL} = \frac{1}{2} U_{IJ} T_{IJ} \]

where \(T_{IJ} = D_{IJKL} U_{KL}\) is a a Hencky stress.

Definition at line 161 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ OpCalculateEnergy()

EshelbianPlasticity::HMHHencky::OpCalculateEnergy::OpCalculateEnergy ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< double total_energy_ptr 
)

Definition at line 982 of file HMHHencky.cpp.

985 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
986 totalEnergyPtr(total_energy_ptr) {
987
988 if (!dataAtPts) {
990 "dataAtPts is not allocated. Please set it before "
991 "using this operator.");
992 }
993
994}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ NOSPACE
Definition definitions.h:83
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts

Member Function Documentation

◆ doWork()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpCalculateEnergy::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 996 of file HMHHencky.cpp.

997 {
999
1004
1005 int nb_integration_pts = getGaussPts().size2();
1006 auto t_log_u =
1007 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
1008
1009
1010 auto &mat_d = dataAtPts->matD;
1011 if (mat_d.size1() != size_symm || mat_d.size2() != size_symm) {
1012 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1013 "wrong matD size, should be 6 by 6 but is %d by %d", size_symm,
1014 size_symm);
1015 }
1016
1017 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(mat_d.data().data());
1018
1019 dataAtPts->energyAtPts.resize(nb_integration_pts, false);
1020 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1021
1022 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1023
1024 t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
1025
1026 ++t_log_u;
1027 ++t_energy;
1028 }
1029
1030 if (totalEnergyPtr) {
1031 auto t_w = getFTensor0IntegrationWeight();
1032 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1033 double loc_energy = 0;
1034 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1035 loc_energy += t_energy * t_w;
1036 ++t_w;
1037 ++t_energy;
1038 }
1039 *totalEnergyPtr += getMeasure() * loc_energy;
1040 }
1041
1043}
#define FTENSOR_INDEX(DIM, I)
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
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static constexpr auto size_symm

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::HMHHencky::OpCalculateEnergy::dataAtPts
private

Definition at line 168 of file HMHHencky.cpp.

◆ totalEnergyPtr

boost::shared_ptr<double> EshelbianPlasticity::HMHHencky::OpCalculateEnergy::totalEnergyPtr
private

Definition at line 169 of file HMHHencky.cpp.


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