v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD > Struct Template Reference

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

Inheritance diagram for EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >:
[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

template<int STRIDEMATD>
struct EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >

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 171 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ OpCalculateEnergy()

template<int STRIDEMATD>
EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >::OpCalculateEnergy ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< double total_energy_ptr 
)

Definition at line 1292 of file HMHHencky.cpp.

1295 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
1296 totalEnergyPtr(total_energy_ptr) {
1297
1298 if (!dataAtPts) {
1300 "dataAtPts is not allocated. Please set it before "
1301 "using this operator.");
1302 }
1303}
#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()

template<int STRIDEMATD>
MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 1306 of file HMHHencky.cpp.

1308 {
1310
1315
1316 int nb_integration_pts = getGaussPts().size2();
1317 auto t_log_u = dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
1318
1319#ifndef NDEBUG
1320 auto &mat_d = dataAtPts->matD;
1321 if (mat_d.size2() != size_symm * size_symm) {
1322 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1323 "wrong matD size, number of columns should be %d but is %zu",
1324 size_symm * size_symm, mat_d.size2());
1325 }
1326 if constexpr (STRIDEMATD != 0) {
1327 if (mat_d.size1() != nb_integration_pts) {
1328 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1329 "wrong matD size, number of rows should be %d but is %zu",
1330 nb_integration_pts, mat_d.size1());
1331 }
1332 }
1333#endif
1334
1335 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1336
1337 dataAtPts->energyAtPts.resize(nb_integration_pts, false);
1338 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1339
1340 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1341
1342 t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
1343
1344 ++t_D;
1345 ++t_log_u;
1346 ++t_energy;
1347 }
1348
1349 if (totalEnergyPtr) {
1350 auto t_w = getFTensor0IntegrationWeight();
1351 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1352 double loc_energy = 0;
1353 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1354 loc_energy += t_energy * t_w;
1355 ++t_w;
1356 ++t_energy;
1357 }
1358 *totalEnergyPtr += getMeasure() * loc_energy;
1359 }
1360
1362}
#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

template<int STRIDEMATD>
boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >::dataAtPts
private

Definition at line 178 of file HMHHencky.cpp.

◆ totalEnergyPtr

template<int STRIDEMATD>
boost::shared_ptr<double> EshelbianPlasticity::HMHHencky::OpCalculateEnergy< STRIDEMATD >::totalEnergyPtr
private

Definition at line 179 of file HMHHencky.cpp.


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