v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S > Struct Template Reference

#include "users_modules/multifield-thermoplasticity-private/tutorials/vec-2/src/HenckyOps.hpp"

Inheritance diagram for HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >:
[legend]
Collaboration diagram for HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >:
[legend]

Public Member Functions

 OpCalculateHenckyThermalStressImpl (const std::string field_name, boost::shared_ptr< VectorDouble > temperature, boost::shared_ptr< CommonData > common_data, boost::shared_ptr< VectorDouble > coeff_expansion_ptr, boost::shared_ptr< double > ref_temp_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
 OpCalculateHenckyThermalStressImpl (const std::string field_name, boost::shared_ptr< VectorDouble > temperature, boost::shared_ptr< CommonData > common_data, boost::shared_ptr< VectorDouble > coeff_expansion_ptr, boost::shared_ptr< double > ref_temp_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
boost::shared_ptr< VectorDouble > tempPtr
 
boost::shared_ptr< VectorDouble > coeffExpansionPtr
 
boost::shared_ptr< doublerefTempPtr
 

Detailed Description

template<int DIM, typename DomainEleOp, int S>
struct HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >

Definition at line 342 of file HenckyOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateHenckyThermalStressImpl() [1/2]

template<int DIM, typename DomainEleOp , int S>
HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::OpCalculateHenckyThermalStressImpl ( const std::string  field_name,
boost::shared_ptr< VectorDouble >  temperature,
boost::shared_ptr< CommonData common_data,
boost::shared_ptr< VectorDouble >  coeff_expansion_ptr,
boost::shared_ptr< double ref_temp_ptr 
)
inline

Definition at line 345 of file HenckyOps.hpp.

351 : DomainEleOp(field_name, DomainEleOp::OPROW), tempPtr(temperature),
352 commonDataPtr(common_data), coeffExpansionPtr(coeff_expansion_ptr),
353 refTempPtr(ref_temp_ptr) {
354 std::fill(&DomainEleOp::doEntities[MBEDGE],
355 &DomainEleOp::doEntities[MBMAXTYPE], false);
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
constexpr auto field_name

◆ OpCalculateHenckyThermalStressImpl() [2/2]

template<int DIM, typename DomainEleOp , int S>
HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::OpCalculateHenckyThermalStressImpl ( const std::string  field_name,
boost::shared_ptr< VectorDouble >  temperature,
boost::shared_ptr< CommonData common_data,
boost::shared_ptr< VectorDouble >  coeff_expansion_ptr,
boost::shared_ptr< double ref_temp_ptr 
)
inline

Definition at line 346 of file HenckyOps.hpp.

351 : DomainEleOp(field_name, DomainEleOp::OPROW), tempPtr(temperature),
352 commonDataPtr(common_data), coeffExpansionPtr(coeff_expansion_ptr),
353 refTempPtr(ref_temp_ptr) {
354 std::fill(&DomainEleOp::doEntities[MBEDGE],
355 &DomainEleOp::doEntities[MBMAXTYPE], false);
356 }

Member Function Documentation

◆ doWork() [1/2]

template<int DIM, typename DomainEleOp , int S>
MoFEMErrorCode HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 357 of file HenckyOps.hpp.

358 {
360
361 FTensor::Index<'i', DIM> i;
362 FTensor::Index<'j', DIM> j;
363 FTensor::Index<'k', DIM> k;
364 FTensor::Index<'l', DIM> l;
365
366 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
367
368 // const size_t nb_gauss_pts = matGradPtr->size2();
369 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
370 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*commonDataPtr->matDPtr);
371 auto t_logC = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matLogC);
372 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
373 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
374 commonDataPtr->matHenckyStress.resize(size_symm, nb_gauss_pts, false);
375 commonDataPtr->matFirstPiolaStress.resize(DIM * DIM, nb_gauss_pts, false);
376 commonDataPtr->matSecondPiolaStress.resize(size_symm, nb_gauss_pts, false);
377 auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
378 auto t_P = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matFirstPiolaStress);
379 auto t_S =
380 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
381 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
382 auto t_temp = getFTensor0FromVec(*tempPtr);
383
385 t_coeff_exp(i, j) = 0;
386 for (auto d = 0; d != SPACE_DIM; ++d) {
387 t_coeff_exp(d, d) = (*coeffExpansionPtr)[d];
388 }
389
390 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
391#ifdef HENCKY_SMALL_STRAIN
392 t_P(i, j) = t_D(i, j, k, l) *
393 (t_grad(k, l) - t_coeff_exp(k, l) * (t_temp - (*refTempPtr)));
394#else
395 t_T(i, j) = t_D(i, j, k, l) *
396 (t_logC(k, l) - t_coeff_exp(k, l) * (t_temp - (*refTempPtr)));
398 t_F(i, j) = t_grad(i, j) + t_kd(i, j);
399 t_S(k, l) = t_T(i, j) * t_logC_dC(i, j, k, l);
400 t_P(i, l) = t_F(i, k) * t_S(k, l);
401#endif
402 ++t_grad;
403 ++t_logC;
404 ++t_logC_dC;
405 ++t_P;
406 ++t_T;
407 ++t_S;
408 ++t_D;
409 ++t_temp;
410 }
411
constexpr int SPACE_DIM
[Define dimension]
Kronecker Delta class.
#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()
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr auto size_symm
Definition plastic.cpp:42

◆ doWork() [2/2]

template<int DIM, typename DomainEleOp , int S>
MoFEMErrorCode HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 358 of file HenckyOps.hpp.

358 {
360
361 FTensor::Index<'i', DIM> i;
362 FTensor::Index<'j', DIM> j;
363 FTensor::Index<'k', DIM> k;
364 FTensor::Index<'l', DIM> l;
365
366 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
367
368 // const size_t nb_gauss_pts = matGradPtr->size2();
369 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
370 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*commonDataPtr->matDPtr);
371 auto t_logC = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matLogC);
372 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
373 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
374 commonDataPtr->matHenckyStress.resize(size_symm, nb_gauss_pts, false);
375 commonDataPtr->matFirstPiolaStress.resize(DIM * DIM, nb_gauss_pts, false);
376 commonDataPtr->matSecondPiolaStress.resize(size_symm, nb_gauss_pts, false);
377 auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
378 auto t_P = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matFirstPiolaStress);
379 auto t_S =
380 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
381 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
382 auto t_temp = getFTensor0FromVec(*tempPtr);
383
385 t_coeff_exp(i, j) = 0;
386 for (auto d = 0; d != SPACE_DIM; ++d) {
387 t_coeff_exp(d, d) = (*coeffExpansionPtr)[d];
388 }
389
390 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
391#ifdef HENCKY_SMALL_STRAIN
392 t_P(i, j) = t_D(i, j, k, l) *
393 (t_grad(k, l) - t_coeff_exp(k, l) * (t_temp - (*refTempPtr)));
394#else
395 t_T(i, j) = t_D(i, j, k, l) *
396 (t_logC(k, l) - t_coeff_exp(k, l) * (t_temp - (*refTempPtr)));
398 t_F(i, j) = t_grad(i, j) + t_kd(i, j);
399 t_S(k, l) = t_T(i, j) * t_logC_dC(i, j, k, l);
400 t_P(i, l) = t_F(i, k) * t_S(k, l);
401#endif
402 ++t_grad;
403 ++t_logC;
404 ++t_logC_dC;
405 ++t_P;
406 ++t_T;
407 ++t_S;
408 ++t_D;
409 ++t_temp;
410 }
411
413 }

Member Data Documentation

◆ coeffExpansionPtr

template<int DIM, typename DomainEleOp , int S>
boost::shared_ptr< VectorDouble > HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::coeffExpansionPtr
private

Definition at line 417 of file HenckyOps.hpp.

◆ commonDataPtr

template<int DIM, typename DomainEleOp , int S>
boost::shared_ptr< CommonData > HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::commonDataPtr
private

Definition at line 415 of file HenckyOps.hpp.

◆ refTempPtr

template<int DIM, typename DomainEleOp , int S>
boost::shared_ptr< double > HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::refTempPtr
private

Definition at line 418 of file HenckyOps.hpp.

◆ tempPtr

template<int DIM, typename DomainEleOp , int S>
boost::shared_ptr< VectorDouble > HenckyOps::OpCalculateHenckyThermalStressImpl< DIM, GAUSS, DomainEleOp, S >::tempPtr
private

Definition at line 416 of file HenckyOps.hpp.


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