v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD > Struct Template Reference
Inheritance diagram for EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >:
[legend]

Public Member Functions

 OpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< MatrixDouble > stress_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
 
boost::shared_ptr< MatrixDouble > strainPtr
 
boost::shared_ptr< MatrixDouble > stressPtr
 
boost::shared_ptr< HMHHenckyhenckyPtr
 

Detailed Description

template<int STRIDEMATD = 0>
struct EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >

Definition at line 194 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ OpCalculateStretchFromStress()

template<int STRIDEMATD = 0>
EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >::OpCalculateStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< MatrixDouble >  strain_ptr,
boost::shared_ptr< MatrixDouble >  stress_ptr,
boost::shared_ptr< HMHHencky hencky_ptr 
)

Definition at line 1365 of file HMHHencky.cpp.

1371 : VolUserDataOperator(H1, OPLAST), dataAtPts(data_ptr),
1372 strainPtr(strain_ptr), stressPtr(stress_ptr), henckyPtr(hencky_ptr) {
1373 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
1374 doEntities[MBVERTEX] = true;
1375}
@ H1
continuous field
Definition definitions.h:85
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Function Documentation

◆ doWork()

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

Definition at line 1378 of file HMHHencky.cpp.

1379 {
1381
1388
1389 auto nb_integration_pts = stressPtr->size1();
1390#ifndef NDEBUG
1391 if (nb_integration_pts != getGaussPts().size2()) {
1392 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1393 "inconsistent number of integration points");
1394 }
1395#endif // NDEBUG
1396
1397 CHKERR henckyPtr->computeMaterialParamsAtPts<STRIDEMATD>(this, data,
1398 dataAtPts);
1399
1400 auto get_strain =
1401 MatrixSizeHelper<GetFTensor2SymmetricFromMatType<3, -1, DL>, DL>::size(
1402 *strainPtr, nb_integration_pts);
1403 auto t_strain = get_strain();
1404 auto t_stress = getFTensor2FromMat<SPACE_DIM, SPACE_DIM, -1, DL>(*stressPtr);
1405 auto t_inv_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
1406 dataAtPts->matInvD);
1407#ifndef NDEBUG
1408 auto t_D =
1409 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(dataAtPts->matD);
1410#endif
1411
1413
1414 // note: add rotation, so we can extract rigid body motion, work then with
1415 // symmetric part.
1416 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
1417 t_strain(i, j) = t_inv_D(i, j, k, l) * t_stress(k, l);
1418
1419#ifndef NDEBUG
1420 FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug;
1421 t_stress_symm_debug(i, j) = (t_stress(i, j) || t_stress(j, i)) / 2;
1422 FTensor::Tensor2_symmetric<double, 3> t_stress_symm_debug_diff;
1423 t_stress_symm_debug_diff(i, j) =
1424 t_D(i, j, k, l) * t_strain(k, l) - t_stress_symm_debug(i, j);
1425 double nrm =
1426 t_stress_symm_debug_diff(i, j) * t_stress_symm_debug_diff(i, j);
1427 double nrm0 = t_stress_symm_debug(i, j) * t_stress_symm_debug(i, j) +
1428 std::numeric_limits<double>::epsilon();
1429 constexpr double eps = 1e-10;
1430 if (std::fabs(std::sqrt(nrm / nrm0)) > eps) {
1431 MOFEM_LOG("SELF", Sev::error)
1432 << "Stress symmetry check failed: " << std::endl
1433 << t_stress_symm_debug_diff << std::endl
1434 << t_stress;
1436 "Norm is too big: " + std::to_string(nrm / nrm0));
1437 }
1438 ++t_D;
1439#endif
1440
1441 ++t_strain;
1442 ++t_stress;
1443 ++t_inv_D;
1444 }
1445
1447}
#define FTENSOR_INDEX(DIM, I)
static const double eps
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr auto t_kd
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
decltype(GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2SymmetricFromMatType
auto getFTensor2FromMat(M &data)
Get tensor rank 2 (matrix) form data matrix.
FTensor::Index< 'm', 3 > m

Member Data Documentation

◆ dataAtPts

template<int STRIDEMATD = 0>
boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >::dataAtPts
private

data at integration pts

Definition at line 204 of file HMHHencky.cpp.

◆ henckyPtr

template<int STRIDEMATD = 0>
boost::shared_ptr<HMHHencky> EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >::henckyPtr
private

Definition at line 207 of file HMHHencky.cpp.

◆ strainPtr

template<int STRIDEMATD = 0>
boost::shared_ptr<MatrixDouble> EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >::strainPtr
private

Definition at line 205 of file HMHHencky.cpp.

◆ stressPtr

template<int STRIDEMATD = 0>
boost::shared_ptr<MatrixDouble> EshelbianPlasticity::HMHHencky::OpCalculateStretchFromStress< STRIDEMATD >::stressPtr
private

Definition at line 206 of file HMHHencky.cpp.


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