v0.14.0
Public Member Functions | Public Attributes | List of all members
PhotonDiffusion::OpCameraInteg Struct Reference
Inheritance diagram for PhotonDiffusion::OpCameraInteg:
[legend]
Collaboration diagram for PhotonDiffusion::OpCameraInteg:
[legend]

Public Member Functions

 OpCameraInteg (boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Public Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 114 of file photon_diffusion.cpp.

Constructor & Destructor Documentation

◆ OpCameraInteg()

PhotonDiffusion::OpCameraInteg::OpCameraInteg ( boost::shared_ptr< CommonData common_data_ptr)
inline

Definition at line 116 of file photon_diffusion.cpp.

117  : BoundaryEleOp("PHOTON_FLUENCE_RATE", OPROW),
118  commonDataPtr(common_data_ptr) {
119  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
120  doEntities[MBTRI] = doEntities[MBQUAD] = true;
121  }

Member Function Documentation

◆ doWork()

MoFEMErrorCode PhotonDiffusion::OpCameraInteg::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
Examples
photon_diffusion.cpp.

Definition at line 631 of file photon_diffusion.cpp.

632  {
634  const int nb_integration_pts = getGaussPts().size2();
635  const double area = getMeasure();
636  auto t_w = getFTensor0IntegrationWeight();
637  auto t_val = getFTensor0FromVec(*(commonDataPtr->approxVals));
638 
639  double values_integ = 0;
640 
641  for (int gg = 0; gg != nb_integration_pts; ++gg) {
642  const double alpha = t_w * area;
643 
644  values_integ += alpha * t_val;
645 
646  ++t_w;
647  ++t_val;
648  }
649 
650  constexpr std::array<int, 1> indices = {CommonData::VALUES_INTEG};
651  std::array<double, 1> values;
652  values[0] = values_integ;
653  CHKERR VecSetValues(commonDataPtr->petscVec, 1, indices.data(), values.data(),
654  ADD_VALUES);
656 }

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> PhotonDiffusion::OpCameraInteg::commonDataPtr
Examples
photon_diffusion.cpp.

Definition at line 115 of file photon_diffusion.cpp.


The documentation for this struct was generated from the following file:
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
PhotonDiffusion::OpCameraInteg::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: photon_diffusion.cpp:115
PhotonDiffusion::CommonData::VALUES_INTEG
@ VALUES_INTEG
Definition: photon_diffusion.cpp:107
BoundaryEleOp
BoundaryEle::UserDataOperator BoundaryEleOp
Definition: photon_diffusion.cpp:24
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359