v0.15.0
Loading...
Searching...
No Matches
FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp > Struct Template Reference

#include "tutorials/adv-2/src/FiniteThermalOps.hpp"

Inheritance diagram for FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >:
[legend]
Collaboration diagram for FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >:
[legend]

Public Member Functions

 OpCalculateQdotQRhs (const std::string field_name, boost::shared_ptr< MatrixDouble > vec, ScalarFun resistance_function, boost::shared_ptr< MatrixDouble > mat_Grad_Ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Protected Attributes

boost::shared_ptr< MatrixDouble > fluxVec
 
ScalarFun resistanceFunction
 
boost::shared_ptr< MatrixDouble > matGradPtr
 

Detailed Description

template<int DIM, typename DomainEleOp>
struct FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >

Definition at line 27 of file FiniteThermalOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateQdotQRhs()

template<int DIM, typename DomainEleOp >
FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >::OpCalculateQdotQRhs ( const std::string field_name,
boost::shared_ptr< MatrixDouble > vec,
ScalarFun resistance_function,
boost::shared_ptr< MatrixDouble > mat_Grad_Ptr,
boost::shared_ptr< Range > ents_ptr = nullptr )
inline

Definition at line 29 of file FiniteThermalOps.hpp.

34 : DomainEleOp(field_name, field_name, DomainEleOp::OPROW), fluxVec(vec),
35 resistanceFunction(resistance_function), matGradPtr(mat_Grad_Ptr) {}
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
constexpr auto field_name

Member Function Documentation

◆ iNtegrate()

template<int DIM, typename DomainEleOp >
MoFEMErrorCode FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >::iNtegrate ( EntitiesFieldData::EntData & data)
protected

Definition at line 45 of file FiniteThermalOps.hpp.

46 {
48
49 FTensor::Index<'i', DIM> i;
50 FTensor::Index<'J', DIM> J;
51 FTensor::Index<'m', DIM> m;
52 FTensor::Index<'N', DIM> N;
53
54 const auto nb_integration_pts = DomainEleOp::getGaussPts().size2();
55
57 FTensor::Tensor1<double, DIM> t_K_inv_Q_over_J;
58
59 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
60
61 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(matGradPtr));
62
63 // get element volume
64 const double vol = DomainEleOp::getMeasure();
65 // get integration weights
66 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
67 // get base function gradient on rows
68 auto t_row_base = data.getFTensor1N<3>();
69 // get flux values
70 auto t_flux = getFTensor1FromMat<DIM>(*fluxVec);
71 // get coordinate at integration points
72 auto t_coords = AssemblyDomainEleOp::getFTensor1CoordsAtGaussPts();
73
74 // loop over integration points
75 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
76 // take into account Jacobian
77 const double alpha = t_w * vol;
78
79 t_F(i, J) = t_grad(i, J) + t_kd(i, J); // Deformation gradient
80 auto t_J = determinantTensor(t_F); // Volume jacobian
81
82 t_K_inv_Q_over_J(J) =
83 resistanceFunction(t_coords(0), t_coords(1), t_coords(2)) * t_F(m, J) *
84 t_F(m, N) * t_flux(N) / t_J; // Value which multiplies delta Q
85
86 // loop over rows base functions
87 size_t rr = 0;
88 for (; rr != DomainEleOp::nbRows; ++rr) {
89 DomainEleOp::locF[rr] += t_K_inv_Q_over_J(J) * alpha * (t_row_base(J));
90 ++t_row_base;
91 }
92 for (; rr < DomainEleOp::nbRowBaseFunctions; ++rr)
93 ++t_row_base;
94 ++t_w; // move to another integration weight
95 ++t_coords;
96 ++t_flux;
97 ++t_grad;
98 };
100}
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< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'm', 3 > m
const int N
Definition speed_test.cpp:3

Member Data Documentation

◆ fluxVec

template<int DIM, typename DomainEleOp >
boost::shared_ptr<MatrixDouble> FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >::fluxVec
protected

Definition at line 38 of file FiniteThermalOps.hpp.

◆ matGradPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<MatrixDouble> FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >::matGradPtr
protected

Definition at line 40 of file FiniteThermalOps.hpp.

◆ resistanceFunction

template<int DIM, typename DomainEleOp >
ScalarFun FiniteThermalOps::OpCalculateQdotQRhs< DIM, GAUSS, DomainEleOp >::resistanceFunction
protected

Definition at line 39 of file FiniteThermalOps.hpp.


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