v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CellEngineering::OpElasticEnergy Struct Reference
Inheritance diagram for CellEngineering::OpElasticEnergy:
[legend]
Collaboration diagram for CellEngineering::OpElasticEnergy:
[legend]

Public Member Functions

 OpElasticEnergy (boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< MatrixDouble > stress_ptr, double &energy)
 
MoFEMErrorCode doWork (int, EntityType, EntitiesFieldData::EntData &) override
 

Private Attributes

boost::shared_ptr< MatrixDouble > strainPtr
 
boost::shared_ptr< MatrixDouble > stressPtr
 
doubleenergy
 

Detailed Description

Examples
cell_forces.cpp.

Definition at line 429 of file cell_forces.cpp.

Constructor & Destructor Documentation

◆ OpElasticEnergy()

CellEngineering::OpElasticEnergy::OpElasticEnergy ( boost::shared_ptr< MatrixDouble >  strain_ptr,
boost::shared_ptr< MatrixDouble >  stress_ptr,
double energy 
)
inline

Definition at line 432 of file cell_forces.cpp.

434 : VolumeElementForcesAndSourcesCore::UserDataOperator(
436 strainPtr(strain_ptr), stressPtr(stress_ptr), energy(energy) {}
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< MatrixDouble > stressPtr
boost::shared_ptr< MatrixDouble > strainPtr
@ OPSPACE
operator do Work is execute on space data

Member Function Documentation

◆ doWork()

MoFEMErrorCode CellEngineering::OpElasticEnergy::doWork ( int  ,
EntityType  ,
EntitiesFieldData::EntData  
)
inlineoverride
Examples
cell_forces.cpp.

Definition at line 438 of file cell_forces.cpp.

439 {
441
442 const size_t nb_gauss_pts = getGaussPts().size2();
444 auto get_strain =
446 DL>::get(*strainPtr, nb_gauss_pts);
447 auto get_stress =
449 DL>::get(*stressPtr, nb_gauss_pts);
450 auto t_strain = get_strain();
451 auto t_stress = get_stress();
454
455 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
456 const double alpha = getMeasure() * getGaussPts()(SPACE_DIM, gg);
457 energy += 0.5 * alpha * t_strain(i, j) * t_stress(i, j);
458 ++t_strain;
459 ++t_stress;
460 }
461
463 }
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< 'j', 3 > j
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2SymmetricFromMatType

Member Data Documentation

◆ energy

double& CellEngineering::OpElasticEnergy::energy
private
Examples
cell_forces.cpp.

Definition at line 468 of file cell_forces.cpp.

◆ strainPtr

boost::shared_ptr<MatrixDouble> CellEngineering::OpElasticEnergy::strainPtr
private
Examples
cell_forces.cpp.

Definition at line 466 of file cell_forces.cpp.

◆ stressPtr

boost::shared_ptr<MatrixDouble> CellEngineering::OpElasticEnergy::stressPtr
private
Examples
cell_forces.cpp.

Definition at line 467 of file cell_forces.cpp.


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