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

Public Member Functions

 OpRadiationLhs (boost::shared_ptr< VectorDouble > &approx_vals)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_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 aSsemble (EntData &row_data, EntData &col_data)
 Assemble local entity block matrix. More...
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. 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 74 of file lesson6_radiation.cpp.

Constructor & Destructor Documentation

◆ OpRadiationLhs()

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

Definition at line 81 of file lesson6_radiation.cpp.

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

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode Example::OpRadiationLhs::iNtegrate ( EntData row_data,
EntData col_data 
)
virtual

[Radiation Lhs]

Reimplemented from OpTools< EleOp >::OpBase.

Examples
lesson6_radiation.cpp.

Definition at line 293 of file lesson6_radiation.cpp.

294  {
296  // get element volume
297  const double vol = OpFaceBase::getMeasure();
298  // get integration weights
299  auto t_w = OpFaceBase::getFTensor0IntegrationWeight();
300  // get base function gradient on rows
301  auto t_row_base = row_data.getFTensor0N();
302  // gat temperature at integration points
303  auto t_val = getFTensor0FromVec(*(approxVals));
304  // get coordinate at integration points
305  auto t_coords = OpFaceBase::getFTensor1CoordsAtGaussPts();
306 
307  // loop over integration points
308  for (int gg = 0; gg != OpFaceBase::nbIntegrationPts; gg++) {
309 
310  // Cylinder radius
311  const double r_cylinder = t_coords(0);
312 
313  // take into account Jacobean
314  const double alpha = t_w * vol * Beta * (2 * M_PI * r_cylinder);
315  // loop over rows base functions
316  for (int rr = 0; rr != OpFaceBase::nbRows; ++rr) {
317  auto t_col_base = col_data.getFTensor0N(gg, 0);
318  // loop over columns
319  for (int cc = 0; cc != OpFaceBase::nbCols; cc++) {
320  if (std::abs(t_coords(0)) > std::numeric_limits<double>::epsilon()) {
321  locMat(rr, cc) += alpha * t_row_base * t_col_base * 4 * pow(t_val, 3);
322  }
323  ++t_col_base;
324  }
325  ++t_row_base;
326  }
327 
328  ++t_val;
329  ++t_coords;
330  ++t_w; // move to another integration weight
331  }
333 }
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
int nbCols
number if dof on column
Definition: BaseOps.hpp:57
MatrixDouble locMat
local entity block matrix
Definition: BaseOps.hpp:60
constexpr double Beta
boost::shared_ptr< VectorDouble > approxVals
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::OpRadiationLhs::approxVals
private

Definition at line 77 of file lesson6_radiation.cpp.

◆ i

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

summit Index

Definition at line 78 of file lesson6_radiation.cpp.


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