v0.9.2
Public Member Functions | Private Attributes | List of all members
Example::OpRadiationRhs Struct Reference
Inheritance diagram for Example::OpRadiationRhs:
[legend]
Collaboration diagram for Example::OpRadiationRhs:
[legend]

Public Member Functions

 OpRadiationRhs (boost::shared_ptr< VectorDouble > &approx_vals)
 
MoFEMErrorCode iNtegrate (EntData &row_data)
 [Radiation Lhs] More...
 
- Public Member Functions inherited from OpTools< EleOp >::OpBase
 OpBase (const std::string row_field_name, const std::string col_field_name, const typename EleOp::OpType type, boost::shared_ptr< std::vector< bool >> boundary_marker=nullptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 

Private Attributes

boost::shared_ptr< VectorDoubleapproxVals
 
FTensor::Index< 'i', 2 > i
 summit Index More...
 

Additional Inherited Members

- Protected Member Functions inherited from OpTools< EleOp >::OpBase
MoFEMErrorCode applyBoundaryMarker (EntData &data)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data)
 Assemble local entity block matrix. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Class dedicated to assemble operator to global system vector. More...
 
- Protected Attributes inherited from OpTools< EleOp >::OpBase
boost::shared_ptr< std::vector< bool > > boundaryMarker
 
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
MatrixDouble locMat
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

Detailed Description

Definition at line 87 of file lesson6_radiation.cpp.

Constructor & Destructor Documentation

◆ OpRadiationRhs()

Example::OpRadiationRhs::OpRadiationRhs ( boost::shared_ptr< VectorDouble > &  approx_vals)

Definition at line 94 of file lesson6_radiation.cpp.

95  : OpFaceBase("U", "U", OpFaceBase::OPROW), approxVals(approx_vals) {}
boost::shared_ptr< VectorDouble > approxVals
OpTools< BoundaryEleOp >::OpBase OpFaceBase

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode Example::OpRadiationRhs::iNtegrate ( EntData row_data)
virtual

[Radiation Lhs]

[Radiation Lhs]

Reimplemented from OpTools< EleOp >::OpBase.

Examples
lesson6_radiation.cpp.

Definition at line 337 of file lesson6_radiation.cpp.

337  {
339  // get element volume
340  const double vol = OpFaceBase::getMeasure();
341  // get integration weights
342  auto t_w = OpFaceBase::getFTensor0IntegrationWeight();
343  // get base function gradient on rows
344  auto t_row_base = row_data.getFTensor0N();
345  // gat temperature at integration points
346  auto t_val = getFTensor0FromVec(*(approxVals));
347  // get coordinate at integration points
348  auto t_coords = OpFaceBase::getFTensor1CoordsAtGaussPts();
349 
350  // loop over integration points
351  for (int gg = 0; gg != OpFaceBase::nbIntegrationPts; gg++) {
352 
353  // Cylinder radius
354  const double r_cylinder = t_coords(0);
355 
356  // take into account Jacobean
357  const double alpha = t_w * vol * Beta * (2 * M_PI * r_cylinder);
358  // loop over rows base functions
359  for (int rr = 0; rr != OpFaceBase::nbRows; ++rr) {
360  if (std::abs(t_coords(0)) > std::numeric_limits<double>::epsilon()) {
361  OpFaceBase::locF[rr] +=
362  alpha * t_row_base * (pow(t_val, 4) - pow(T_ambient, 4));
363  }
364  ++t_row_base;
365  }
366  ++t_coords;
367  ++t_val;
368  ++t_w; // move to another integration weight
369  }
370 
372 }
static FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:141
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
boost::shared_ptr< VectorDouble > approxVals
VectorDouble locF
local entity vector
Definition: BaseOps.hpp:61
constexpr double Beta
constexpr double T_ambient
int nbIntegrationPts
number of integration points
Definition: BaseOps.hpp:58
int nbRows
number of dofs on rows
Definition: BaseOps.hpp:56
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.

Member Data Documentation

◆ approxVals

boost::shared_ptr<VectorDouble> Example::OpRadiationRhs::approxVals
private

Definition at line 90 of file lesson6_radiation.cpp.

◆ i

FTensor::Index<'i', 2> Example::OpRadiationRhs::i
private

summit Index

Definition at line 91 of file lesson6_radiation.cpp.


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