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

1372 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
1373 totalEnergyPtr(total_energy_ptr) {
1374
1375 if (!dataAtPts) {
1377 "dataAtPts is not allocated. Please set it before "
1378 "using this operator.");
1379 }
1380}
#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 1383 of file HMHHencky.cpp.

1385 {
1387
1392
1393 int nb_integration_pts = getGaussPts().size2();
1394 auto t_log_u = dataAtPts->getFTensorLogStretchTotal(nb_integration_pts);
1395
1396#ifndef NDEBUG
1397 auto &mat_d = dataAtPts->matD;
1398 if (mat_d.size2() != size_symm * size_symm) {
1399 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1400 "wrong matD size, number of columns should be %d but is %zu",
1401 size_symm * size_symm, mat_d.size2());
1402 }
1403 if constexpr (STRIDEMATD != 0) {
1404 if (mat_d.size1() != nb_integration_pts) {
1405 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1406 "wrong matD size, number of rows should be %d but is %zu",
1407 nb_integration_pts, mat_d.size1());
1408 }
1409 }
1410#endif
1411
1412 auto t_D = getFTensor4DdgFromMat<3, 3, STRIDEMATD>(dataAtPts->matD);
1413
1414 dataAtPts->energyAtPts.resize(nb_integration_pts, false);
1415 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1416
1417 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1418
1419 t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
1420
1421 ++t_D;
1422 ++t_log_u;
1423 ++t_energy;
1424 }
1425
1426 if (totalEnergyPtr) {
1427 auto t_w = getFTensor0IntegrationWeight();
1428 auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
1429 double loc_energy = 0;
1430 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1431 loc_energy += t_energy * t_w;
1432 ++t_w;
1433 ++t_energy;
1434 }
1435 *totalEnergyPtr += getMeasure() * loc_energy;
1436 }
1437
1439}
#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 225 of file HMHHencky.cpp.

◆ totalEnergyPtr

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

Definition at line 226 of file HMHHencky.cpp.


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