v0.13.2
Loading...
Searching...
No Matches
CalculateTraction.hpp
Go to the documentation of this file.
1/**
2 * @file CalculateTraction.hpp
3 * @brief Calculate traction for linear problem
4 * @date 2023-03-29
5 *
6 * @copyright Copyright (c) 2023
7 *
8 */
9
10namespace ElasticExample {
11
13 OpCalculateTraction(boost::shared_ptr<MatrixDouble> stress_ptr,
14 boost::shared_ptr<MatrixDouble> traction_ptr)
16 tractionPtr(traction_ptr) {}
17
18 MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
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 }
36
37private:
38 boost::shared_ptr<MatrixDouble> stressPtr;
39 boost::shared_ptr<MatrixDouble> tractionPtr;
40};
41
42} // namespace ElasticExample
constexpr int SPACE_DIM
@ NOSPACE
Definition: definitions.h:83
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpCalculateTraction(boost::shared_ptr< MatrixDouble > stress_ptr, boost::shared_ptr< MatrixDouble > traction_ptr)
boost::shared_ptr< MatrixDouble > tractionPtr
boost::shared_ptr< MatrixDouble > stressPtr
Data on single entity (This is passed as argument to DataOperator::doWork)
@ OPSPACE
operator do Work is execute on space data
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element