v0.15.0
Loading...
Searching...
No Matches
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]
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=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.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Private Attributes

FTensor::Index< 'i', 2 > i
 summit Index
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 assumes that time variable is set
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

Detailed Description

Definition at line 91 of file radiation.cpp.

Constructor & Destructor Documentation

◆ OpFluxRhs()

Example::OpFluxRhs::OpFluxRhs ( )
inline

Definition at line 97 of file radiation.cpp.

97: OpBase("T", "T", OpBase::OPROW) {}
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

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

[Radiation Lhs]

[Flux Rhs]

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 454 of file radiation.cpp.

454 {
456 // get element volume
457 const double vol = getMeasure();
458 // get integration weights
459 auto t_w = getFTensor0IntegrationWeight();
460 // get base function gradient on rows
461 auto t_row_base = row_data.getFTensor0N();
462 // get coordinate at integration points
463 auto t_coords = getFTensor1CoordsAtGaussPts();
464 // // get time
465 const double time = getFEMethod()->ts_t;
466
467 // Look to https://doi.org/10.1016/j.icarus.2014.12.028s
468 constexpr double flux_p = -0.03e6;
469 constexpr double flux_c = -0.23e6;
470
471 // loop over integration points
472 for (int gg = 0; gg != nbIntegrationPts; gg++) {
473
474 // Cylinder radius
475 const double r_cylinder = t_coords(0);
476
477 const double r = std::sqrt(t_coords(i) * t_coords(i));
478 const double s = std::abs(t_coords(1)) / r;
479
480 // take into account Jacobean
481 const double alpha = t_w * vol * (2 * M_PI * r_cylinder);
482 // loop over rows base functions
483 for (int rr = 0; rr != nbRows; ++rr) {
484 locF[rr] += alpha * t_row_base * (s * flux_p + flux_c) * time;
485 ++t_row_base;
486 }
487 ++t_coords;
488 ++t_w; // move to another integration weight
489 }
490
492}
#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()
int r
Definition sdf.py:8
FTensor::Index< 'i', 2 > i
summit Index
Definition radiation.cpp:94
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points

Member Data Documentation

◆ i

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

summit Index

Definition at line 94 of file radiation.cpp.


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