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

#include "tutorials/vec-2_nonlinear_elasticity/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 340 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 343 of file HenckyOps.hpp.

348 : DomainEleOp(field_name, DomainEleOp::OPROW), tempPtr(temperature),
349 commonDataPtr(common_data), coeffExpansionPtr(coeff_expansion_ptr),
350 refTempPtr(ref_temp_ptr) {
351 std::fill(&DomainEleOp::doEntities[MBEDGE],
352 &DomainEleOp::doEntities[MBMAXTYPE], false);
353 }
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 352 of file HenckyOps.hpp.

357 : DomainEleOp(field_name, DomainEleOp::OPROW), tempPtr(temperature),
358 commonDataPtr(common_data), coeffExpansionPtr(coeff_expansion_ptr),
359 refTempPtr(ref_temp_ptr) {
360 std::fill(&DomainEleOp::doEntities[MBEDGE],
361 &DomainEleOp::doEntities[MBMAXTYPE], false);
362 }

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 355 of file HenckyOps.hpp.

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

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

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 415 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 413 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 416 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 414 of file HenckyOps.hpp.


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