v0.14.0
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 138 of file Hencky.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 778 of file Hencky.cpp.

781  : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
782  totalEnergyPtr(total_energy_ptr) {}

Member Function Documentation

◆ doWork()

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

Definition at line 784 of file Hencky.cpp.

785  {
787 
792 
793  int nb_integration_pts = getGaussPts().size2();
794  auto t_log_u =
795  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
796  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
797 
798  dataAtPts->energyAtPts.resize(nb_integration_pts, false);
799  auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
800 
801  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
802 
803  t_energy = 0.5 * (t_log_u(i, j) * (t_D(i, j, k, l) * t_log_u(k, l)));
804 
805  ++t_log_u;
806  ++t_energy;
807  }
808 
809  if (totalEnergyPtr) {
810  auto t_w = getFTensor0IntegrationWeight();
811  auto t_energy = getFTensor0FromVec(dataAtPts->energyAtPts);
812  double loc_energy = 0;
813  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
814  loc_energy += t_energy * t_w;
815  ++t_w;
816  ++t_energy;
817  }
818  *totalEnergyPtr += getMeasure() * loc_energy;
819  }
820 
822 }

Member Data Documentation

◆ dataAtPts

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

Definition at line 145 of file Hencky.cpp.

◆ totalEnergyPtr

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

Definition at line 146 of file Hencky.cpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::totalEnergyPtr
boost::shared_ptr< double > totalEnergyPtr
Definition: Hencky.cpp:146
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
EshelbianPlasticity::HMHHencky::OpCalculateEnergy::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Definition: Hencky.cpp:145
EshelbianPlasticity::VolUserDataOperator
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
Definition: EshelbianPlasticity.hpp:51
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21