v0.15.0
Loading...
Searching...
No Matches
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 160 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 932 of file HMHHencky.cpp.

935 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
936 totalEnergyPtr(total_energy_ptr) {
937
938 if (!dataAtPts) {
940 "dataAtPts is not allocated. Please set it before "
941 "using this operator.");
942 }
943
944}
#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 946 of file HMHHencky.cpp.

947 {
949
954
955 int nb_integration_pts = getGaussPts().size2();
956 auto t_log_u =
957 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
958
959
960 auto &mat_d = dataAtPts->matD;
961 if (mat_d.size1() != size_symm || mat_d.size2() != size_symm) {
962 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
963 "wrong matD size, should be 6 by 6 but is %d by %d", size_symm,
964 size_symm);
965 }
966
967 auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(mat_d.data().data());
968
969 dataAtPts->energyAtPts.resize(nb_integration_pts, false);
970 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
971
972 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
973
974 t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
975
976 ++t_log_u;
977 ++t_energy;
978 }
979
980 if (totalEnergyPtr) {
981 auto t_w = getFTensor0IntegrationWeight();
982 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
983 double loc_energy = 0;
984 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
985 loc_energy += t_energy * t_w;
986 ++t_w;
987 ++t_energy;
988 }
989 *totalEnergyPtr += getMeasure() * loc_energy;
990 }
991
993}
#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 167 of file HMHHencky.cpp.

◆ totalEnergyPtr

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

Definition at line 168 of file HMHHencky.cpp.


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