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

#include <tutorials/vec-0/src/CalculateTraction.hpp>

Inheritance diagram for ElasticExample::OpCalculateTraction:
[legend]
Collaboration diagram for ElasticExample::OpCalculateTraction:
[legend]

Public Member Functions

 OpCalculateTraction (boost::shared_ptr< MatrixDouble > stress_ptr, boost::shared_ptr< MatrixDouble > traction_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< MatrixDouble > stressPtr
 
boost::shared_ptr< MatrixDouble > tractionPtr
 

Detailed Description

Definition at line 12 of file CalculateTraction.hpp.

Constructor & Destructor Documentation

◆ OpCalculateTraction()

ElasticExample::OpCalculateTraction::OpCalculateTraction ( boost::shared_ptr< MatrixDouble >  stress_ptr,
boost::shared_ptr< MatrixDouble >  traction_ptr 
)
inline

Definition at line 13 of file CalculateTraction.hpp.

15  : BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE), stressPtr(stress_ptr),
16  tractionPtr(traction_ptr) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode ElasticExample::OpCalculateTraction::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 18 of file CalculateTraction.hpp.

18  {
22  auto nb_int_pts = getGaussPts().size2();
23  tractionPtr->resize(SPACE_DIM, nb_int_pts, false);
24  auto t_normal = getFTensor1NormalsAtGaussPts();
25  auto t_stress = getFTensor2SymmetricFromMat<SPACE_DIM>(*stressPtr);
26  auto t_traction = getFTensor1FromMat<SPACE_DIM>(*tractionPtr);
27  for (auto gg = 0; gg != nb_int_pts; ++gg) {
28  const auto l = std::sqrt(t_normal(j) * t_normal(j));
29  t_traction(i) = (t_stress(i, j) * t_normal(j)) / l;
30  ++t_normal;
31  ++t_stress;
32  ++t_traction;
33  }
35  }

Member Data Documentation

◆ stressPtr

boost::shared_ptr<MatrixDouble> ElasticExample::OpCalculateTraction::stressPtr
private

Definition at line 38 of file CalculateTraction.hpp.

◆ tractionPtr

boost::shared_ptr<MatrixDouble> ElasticExample::OpCalculateTraction::tractionPtr
private

Definition at line 39 of file CalculateTraction.hpp.


The documentation for this struct was generated from the following file:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
ElasticExample::OpCalculateTraction::tractionPtr
boost::shared_ptr< MatrixDouble > tractionPtr
Definition: CalculateTraction.hpp:39
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
BoundaryEleOp
BoundaryEle::UserDataOperator BoundaryEleOp
Definition: child_and_parent.cpp:40
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', SPACE_DIM >
ElasticExample::OpCalculateTraction::stressPtr
boost::shared_ptr< MatrixDouble > stressPtr
Definition: CalculateTraction.hpp:38
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
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