v0.14.0
Public Member Functions | Private Attributes | List of all members
ThermoElasticOps::OpStressThermal Struct Reference

#include <tutorials/adv-2/src/ThermoElasticOps.hpp>

Inheritance diagram for ThermoElasticOps::OpStressThermal:
[legend]
Collaboration diagram for ThermoElasticOps::OpStressThermal:
[legend]

Public Member Functions

DEPRECATED OpStressThermal (const std::string field_name, boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< VectorDouble > temp_ptr, boost::shared_ptr< MatrixDouble > m_D_ptr, boost::shared_ptr< VectorDouble > coeff_expansion_ptr, boost::shared_ptr< MatrixDouble > stress_ptr)
 
 OpStressThermal (boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< VectorDouble > temp_ptr, boost::shared_ptr< MatrixDouble > m_D_ptr, boost::shared_ptr< VectorDouble > coeff_expansion_ptr, boost::shared_ptr< MatrixDouble > stress_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 [Calculate stress] More...
 

Private Attributes

boost::shared_ptr< MatrixDouble > strainPtr
 
boost::shared_ptr< VectorDouble > tempPtr
 
boost::shared_ptr< MatrixDouble > mDPtr
 
boost::shared_ptr< VectorDouble > coeffExpansionPtr
 
boost::shared_ptr< MatrixDouble > stressPtr
 

Detailed Description

Examples
thermo_elastic.cpp.

Definition at line 23 of file ThermoElasticOps.hpp.

Constructor & Destructor Documentation

◆ OpStressThermal() [1/2]

ThermoElasticOps::OpStressThermal::OpStressThermal ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  strain_ptr,
boost::shared_ptr< VectorDouble >  temp_ptr,
boost::shared_ptr< MatrixDouble >  m_D_ptr,
boost::shared_ptr< VectorDouble >  coeff_expansion_ptr,
boost::shared_ptr< MatrixDouble >  stress_ptr 
)
Deprecated:
do not use this constructor
Examples
ThermoElasticOps.hpp.

Definition at line 115 of file ThermoElasticOps.hpp.

121  : DomainEleOp(field_name, DomainEleOp::OPROW), strainPtr(strain_ptr),
122  tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
123  stressPtr(stress_ptr) {
124  // Operator is only executed for vertices
125  std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
126 }

◆ OpStressThermal() [2/2]

ThermoElasticOps::OpStressThermal::OpStressThermal ( boost::shared_ptr< MatrixDouble >  strain_ptr,
boost::shared_ptr< VectorDouble >  temp_ptr,
boost::shared_ptr< MatrixDouble >  m_D_ptr,
boost::shared_ptr< VectorDouble >  coeff_expansion_ptr,
boost::shared_ptr< MatrixDouble >  stress_ptr 
)

Definition at line 128 of file ThermoElasticOps.hpp.

134  : DomainEleOp(NOSPACE, DomainEleOp::OPSPACE), strainPtr(strain_ptr),
135  tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
136  stressPtr(stress_ptr) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode ThermoElasticOps::OpStressThermal::doWork ( int  side,
EntityType  type,
EntData data 
)

[Calculate stress]

Examples
ThermoElasticOps.hpp.

Definition at line 139 of file ThermoElasticOps.hpp.

140  {
142  const auto nb_gauss_pts = getGaussPts().size2();
143  stressPtr->resize((SPACE_DIM * (SPACE_DIM + 1)) / 2, nb_gauss_pts);
144 
145  auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*mDPtr);
146  auto t_strain = getFTensor2SymmetricFromMat<SPACE_DIM>(*strainPtr);
147  auto t_stress = getFTensor2SymmetricFromMat<SPACE_DIM>(*stressPtr);
148  auto t_temp = getFTensor0FromVec(*tempPtr);
149 
154 
156  t_coeff_exp(i, j) = 0;
157  for (auto d = 0; d != SPACE_DIM; ++d) {
158  t_coeff_exp(d, d) = (*coeffExpansionPtr)[d];
159  }
160 
161  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
162  t_stress(i, j) = t_D(i, j, k, l) *
163  (t_strain(k, l) - t_coeff_exp(k, l) * (t_temp - ref_temp));
164  ++t_strain;
165  ++t_stress;
166  ++t_temp;
167  }
169 }

Member Data Documentation

◆ coeffExpansionPtr

boost::shared_ptr<VectorDouble> ThermoElasticOps::OpStressThermal::coeffExpansionPtr
private
Examples
ThermoElasticOps.hpp.

Definition at line 47 of file ThermoElasticOps.hpp.

◆ mDPtr

boost::shared_ptr<MatrixDouble> ThermoElasticOps::OpStressThermal::mDPtr
private
Examples
ThermoElasticOps.hpp.

Definition at line 46 of file ThermoElasticOps.hpp.

◆ strainPtr

boost::shared_ptr<MatrixDouble> ThermoElasticOps::OpStressThermal::strainPtr
private
Examples
ThermoElasticOps.hpp.

Definition at line 44 of file ThermoElasticOps.hpp.

◆ stressPtr

boost::shared_ptr<MatrixDouble> ThermoElasticOps::OpStressThermal::stressPtr
private
Examples
ThermoElasticOps.hpp.

Definition at line 48 of file ThermoElasticOps.hpp.

◆ tempPtr

boost::shared_ptr<VectorDouble> ThermoElasticOps::OpStressThermal::tempPtr
private
Examples
ThermoElasticOps.hpp.

Definition at line 45 of file ThermoElasticOps.hpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
ThermoElasticOps::OpStressThermal::mDPtr
boost::shared_ptr< MatrixDouble > mDPtr
Definition: ThermoElasticOps.hpp:46
ref_temp
double ref_temp
Definition: thermo_elastic.cpp:125
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
ThermoElasticOps::OpStressThermal::strainPtr
boost::shared_ptr< MatrixDouble > strainPtr
Definition: ThermoElasticOps.hpp:44
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
Definition: child_and_parent.cpp:36
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
ThermoElasticOps::OpStressThermal::coeffExpansionPtr
boost::shared_ptr< VectorDouble > coeffExpansionPtr
Definition: ThermoElasticOps.hpp:47
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', SPACE_DIM >
ThermoElasticOps::OpStressThermal::stressPtr
boost::shared_ptr< MatrixDouble > stressPtr
Definition: ThermoElasticOps.hpp:48
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
ThermoElasticOps::OpStressThermal::tempPtr
boost::shared_ptr< VectorDouble > tempPtr
Definition: ThermoElasticOps.hpp:45
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