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

Public Member Functions

 OpCalcSurfaceAverageTemperature (boost::shared_ptr< VectorDouble > &approx_vals, double &sum_temp, double &surf)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 [Flux Rhs] More...
 

Private Attributes

boost::shared_ptr< VectorDouble > approxVals
 
double & sumTemperature
 
double & surfaceArea
 

Detailed Description

Definition at line 114 of file radiation.cpp.

Constructor & Destructor Documentation

◆ OpCalcSurfaceAverageTemperature()

Example::OpCalcSurfaceAverageTemperature::OpCalcSurfaceAverageTemperature ( boost::shared_ptr< VectorDouble > &  approx_vals,
double &  sum_temp,
double &  surf 
)

Definition at line 123 of file radiation.cpp.

126  : EdgeEleOp("T", "T", OpBase::OPROW), approxVals(approx_vals),
127  sumTemperature(sum_temp), surfaceArea(surf) {}
EdgeEle::UserDataOperator EdgeEleOp
Definition: radiation.cpp:35
boost::shared_ptr< VectorDouble > approxVals
Definition: radiation.cpp:117

Member Function Documentation

◆ doWork()

MoFEMErrorCode Example::OpCalcSurfaceAverageTemperature::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)

[Flux Rhs]

[Ave Temp]

Definition at line 487 of file radiation.cpp.

488  {
489 
491  if (type == MBVERTEX) {
492  // get element volume
493  const double vol = getMeasure();
494  // get integration weights
495  auto t_w = getFTensor0IntegrationWeight();
496  // gat temperature at integration points
497  auto t_val = getFTensor0FromVec(*(approxVals));
498  // get coordinate at integration points
499  auto t_coords = getFTensor1CoordsAtGaussPts();
500  // number of integration pts
501  size_t nb_integration_pts = getGaussPts().size2();
502 
503  // loop over integration points
504  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
505 
506  // Cylinder radius
507  const double r_cylinder = t_coords(0);
508 
509  // take into account Jacobean
510  const double alpha = t_w * vol * (2 * M_PI * r_cylinder);
511 
512  sumTemperature += alpha * t_val;
513  surfaceArea += alpha;
514 
515  ++t_coords;
516  ++t_val;
517  ++t_w; // move to another integration weight
518  }
519  }
521 }
constexpr double alpha
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:149

Member Data Documentation

◆ approxVals

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

Definition at line 117 of file radiation.cpp.

◆ sumTemperature

double& Example::OpCalcSurfaceAverageTemperature::sumTemperature
private

Definition at line 118 of file radiation.cpp.

◆ surfaceArea

double& Example::OpCalcSurfaceAverageTemperature::surfaceArea
private

Definition at line 119 of file radiation.cpp.


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