v0.15.0
Loading...
Searching...
No Matches
FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true > Struct Template Reference

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

Inheritance diagram for FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >:
[legend]
Collaboration diagram for FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >:
[legend]

Public Member Functions

 OpCalculateQdotQLhs_dU (const std::string row_field_name, const std::string col_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 &row_data, EntitiesFieldData::EntData &col_data)
 

Protected Attributes

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

Detailed Description

template<int DIM, typename AssemblyDomainEleOp>
struct FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >

Definition at line 197 of file FiniteThermalOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateQdotQLhs_dU()

template<int DIM, typename AssemblyDomainEleOp >
FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >::OpCalculateQdotQLhs_dU ( const std::string row_field_name,
const std::string col_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 200 of file FiniteThermalOps.hpp.

206 : AssemblyDomainEleOp(row_field_name, col_field_name,
207 AssemblyDomainEleOp::OPROWCOL),
208 fluxVec(vec), resistanceFunction(resistance_function),
209 matGradPtr(mat_Grad_Ptr) {
210 AssemblyDomainEleOp::sYmm = false;
211 }
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

template<int DIM, typename AssemblyDomainEleOp >
MoFEMErrorCode FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >::iNtegrate ( EntitiesFieldData::EntData & row_data,
EntitiesFieldData::EntData & col_data )
protected

Definition at line 223 of file FiniteThermalOps.hpp.

225 {
227
228 FTensor::Index<'i', DIM> i;
229 FTensor::Index<'J', DIM> J;
230 FTensor::Index<'m', DIM> m;
231 FTensor::Index<'M', DIM> M;
232 FTensor::Index<'l', DIM> l;
233 FTensor::Index<'L', DIM> L;
234
235 auto t_w = this->getFTensor0IntegrationWeight();
236
237 // Always need three components for vectorial basis
238 auto t_row_base = row_data.getFTensor1N<3>();
239
241 FTensor::Tensor2<double, DIM, DIM> t_right_Cauchy_Green;
246 FTensor::Tensor2<double, DIM, DIM> t_FtF_Finv_Q_row_base;
248
249 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
250
251 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(matGradPtr));
252
253 // get flux values
254 auto t_flux = getFTensor1FromMat<DIM>(*fluxVec);
255
256 // for each integration point
257 for (size_t gg = 0; gg != AssemblyDomainEleOp::nbIntegrationPts; ++gg) {
258
259 t_F(i, J) = t_grad(i, J) + t_kd(i, J); // Deformation gradient
260 auto t_J = determinantTensor(t_F); // Volume jacobian
261 CHKERR invertTensor(t_F, t_J, t_F_inv);
262
263 t_right_Cauchy_Green(M, L) =
264 t_F(i, M) *
265 t_F(i, L); // The inverse of the material thermal conductivity tensor
266
267 const double alpha = this->getMeasure() * t_w;
268
269 // get the vector of the local matrix for the derivative wrt a vectorial
270 // field with a scalar basis
271 auto t_vec = getFTensor1FromPtr<DIM>(&this->locMat(0, 0));
272
273 // get coordinate at integration points
274 auto t_coords = AssemblyDomainEleOp::getFTensor1CoordsAtGaussPts();
275
276 auto alpha_resistance_Jinv =
277 alpha * resistanceFunction(t_coords(0), t_coords(1), t_coords(2)) / t_J;
278 t_F_flux(l) = t_F(l, L) * t_flux(L);
279
280 t_FtF_Q(M) = t_right_Cauchy_Green(M, L) * t_flux(L);
281
282 // for each row coefficient
283 size_t rr = 0;
284 for (; rr != AssemblyDomainEleOp::nbRows; ++rr) {
285 auto t_col_grad_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
286
287 t_FtF_Finv_Q_row_base(J, l) = t_FtF_Q(M) * t_row_base(M) * t_F_inv(J, l);
288 t_F_row_base(l) = t_F(l, M) * t_row_base(M);
289 t_F_Q_row_base(l, M) = t_F_flux(l) * t_row_base(M);
290
291 // for each coupled coefficient in the columns
292 // divied by DIM since scalar basis for vectorial field
293 for (size_t cc = 0; cc != AssemblyDomainEleOp::nbCols / DIM; ++cc) {
294 t_vec(l) += alpha_resistance_Jinv *
295 (-t_FtF_Finv_Q_row_base(J, l) * t_col_grad_base(J) +
296 t_F_Q_row_base(l, M) * t_col_grad_base(M) +
297 t_F_row_base(l) * t_col_grad_base(L) * t_flux(L));
298 ++t_col_grad_base;
299 ++t_vec;
300 }
301 ++t_row_base;
302 }
303 for (; rr < AssemblyDomainEleOp::nbRowBaseFunctions; ++rr)
304 ++t_row_base;
305
306 ++t_w; // move to another integration weight
307 ++t_coords;
308 ++t_flux;
309 ++t_grad;
310 }
311
313}
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()
#define CHKERR
Inline error check.
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'M', 3 > M
FTensor::Index< 'm', 3 > m

Member Data Documentation

◆ fluxVec

template<int DIM, typename AssemblyDomainEleOp >
boost::shared_ptr<MatrixDouble> FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >::fluxVec
protected

Definition at line 214 of file FiniteThermalOps.hpp.

◆ matGradPtr

template<int DIM, typename AssemblyDomainEleOp >
boost::shared_ptr<MatrixDouble> FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >::matGradPtr
protected

Definition at line 216 of file FiniteThermalOps.hpp.

◆ resistanceFunction

template<int DIM, typename AssemblyDomainEleOp >
ScalarFun FiniteThermalOps::OpCalculateQdotQLhs_dU< DIM, GAUSS, AssemblyDomainEleOp, true >::resistanceFunction
protected

Definition at line 215 of file FiniteThermalOps.hpp.


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