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

Public Member Functions

 OpFluxRhs ()
 
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

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 100 of file lesson6_radiation.cpp.

Constructor & Destructor Documentation

◆ OpFluxRhs()

Example::OpFluxRhs::OpFluxRhs ( )

Definition at line 106 of file lesson6_radiation.cpp.

106 : OpFaceBase("U", "U", OpFaceBase::OPROW) {}
OpTools< BoundaryEleOp >::OpBase OpFaceBase

Member Function Documentation

◆ iNtegrate()

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

[Radiation Lhs]

[Flux Rhs]

Reimplemented from OpTools< EleOp >::OpBase.

Examples
lesson6_radiation.cpp.

Definition at line 376 of file lesson6_radiation.cpp.

376  {
378  // get element volume
379  const double vol = OpFaceBase::getMeasure();
380  // get integration weights
381  auto t_w = OpFaceBase::getFTensor0IntegrationWeight();
382  // get base function gradient on rows
383  auto t_row_base = row_data.getFTensor0N();
384  // get coordinate at integration points
385  auto t_coords = OpFaceBase::getFTensor1CoordsAtGaussPts();
386  // get time
387  const double time = OpFaceBase::getFEMethod()->ts_t;
388 
389  // loop over integration points
390  for (int gg = 0; gg != OpFaceBase::nbIntegrationPts; gg++) {
391 
392  // Cylinder radius
393  const double r_cylinder = t_coords(0);
394 
395  const double r = sqrt(t_coords(i) * t_coords(i));
396  const double c = std::abs(t_coords(0)) / r;
397 
398  // take into account Jacobean
399  const double alpha = t_w * vol * (2 * M_PI * r_cylinder);
400  // loop over rows base functions
401  for (int rr = 0; rr != OpFaceBase::nbRows; ++rr) {
402  OpFaceBase::locF[rr] += alpha * t_row_base * c * Flux * time;
403  ++t_row_base;
404  }
405  ++t_coords;
406  ++t_w; // move to another integration weight
407  }
408 
410 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
constexpr double Flux
VectorDouble locF
local entity vector
Definition: BaseOps.hpp:61
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::Index< 'i', 2 > i
summit Index
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.

Member Data Documentation

◆ i

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

summit Index

Definition at line 103 of file lesson6_radiation.cpp.


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