v0.14.0
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress:
[legend]

Public Member Functions

 OpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< HMHHencky > hencky_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
boost::shared_ptr< HMHHenckyhenckyPtr
 

Detailed Description

Definition at line 155 of file Hencky.cpp.

Constructor & Destructor Documentation

◆ OpCalculateStretchFromStress()

EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::OpCalculateStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< HMHHencky hencky_ptr 
)

Definition at line 824 of file Hencky.cpp.

827  : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
828  henckyPtr(hencky_ptr) {}

Member Function Documentation

◆ doWork()

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

Definition at line 830 of file Hencky.cpp.

832  {
834 
841 
842  auto nb_integration_pts = dataAtPts->approxPAtPts.size2();
843 #ifdef NDEBUG
844  if (nb_integration_pts != getGaussPts().size2()) {
845  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
846  "inconsistent number of integration points");
847  }
848 #endif // NDEBUG
849 
850  auto get_D = [&]() {
852  for (auto &b : henckyPtr->blockData) {
853 
854  if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
855  dataAtPts->mu = b.bulkModulusK;
856  dataAtPts->lambda = b.bulkModulusK;
857  CHKERR henckyPtr->getMatDPtr(
858  dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
859  dataAtPts->getMatDeviatorDPtr(), b.bulkModulusK, b.shearModulusG);
861  }
862  }
863 
864  const auto E = henckyPtr->E;
865  const auto nu = henckyPtr->nu;
866 
867  double bulk_modulus_K = E / (3 * (1 - 2 * nu));
868  double shear_modulus_G = E / (2 * (1 + nu));
869 
871  dataAtPts->lambda = bulk_modulus_K;
872 
873  CHKERR henckyPtr->getMatDPtr(
874  dataAtPts->getMatDPtr(), dataAtPts->getMatAxiatorDPtr(),
875  dataAtPts->getMatDeviatorDPtr(), bulk_modulus_K, shear_modulus_G);
877  };
878 
879  auto get_invert_D = [&]() {
881  dataAtPts->matInvD.resize(size_symm, size_symm, false);
882  noalias(dataAtPts->matInvD) = dataAtPts->matD;
885  };
886 
887  CHKERR get_D();
888  CHKERR get_invert_D();
889 
890  dataAtPts->logStretchTensorAtPts.resize(size_symm, nb_integration_pts, false);
891 
892  auto t_log_u =
893  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTensorAtPts);
894  auto t_approx_P =
895  getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->approxPAtPts);
896  auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
897  &*dataAtPts->matInvD.data().begin());
898 
899  // note: add rotation, so we can extract rigid body motion, work then with
900  // symmetric part.
901  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
902  t_log_u(i, j) = t_inv_D(i, j, k, l) * t_approx_P(k, l);
903  ++t_log_u;
904  ++t_approx_P;
905  ++t_inv_D;
906  }
907 
909 }

Member Data Documentation

◆ dataAtPts

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

data at integration pts

Definition at line 163 of file Hencky.cpp.

◆ henckyPtr

boost::shared_ptr<HMHHencky> EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::henckyPtr
private

Definition at line 164 of file Hencky.cpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
get_D
auto get_D
Definition: free_surface.cpp:252
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:39
E
bulk_modulus_K
double bulk_modulus_K
Definition: dynamic_first_order_con_law.cpp:96
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::henckyPtr
boost::shared_ptr< HMHHencky > henckyPtr
Definition: Hencky.cpp:164
EshelbianPlasticity::HMHHencky::nu
double nu
Definition: Hencky.cpp:284
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: Hencky.cpp:163
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
EshelbianPlasticity::VolUserDataOperator
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
Definition: EshelbianPlasticity.hpp:51
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
convert.n
n
Definition: convert.py:82
shear_modulus_G
double shear_modulus_G
Definition: dynamic_first_order_con_law.cpp:97
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::computeMatrixInverse
MoFEMErrorCode computeMatrixInverse(MatrixDouble &mat)
compute matrix inverse with lapack dgetri
Definition: Templates.hpp:1365
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
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