v0.14.0
Public Member Functions | Protected Attributes | List of all members
OpElectrodeCharge< SPACE_DIM > Struct Template Reference

#include <tutorials/scl-12/src/electrostatics.hpp>

Inheritance diagram for OpElectrodeCharge< SPACE_DIM >:
[legend]
Collaboration diagram for OpElectrodeCharge< SPACE_DIM >:
[legend]

Public Member Functions

 OpElectrodeCharge (const std::string field_name, boost::shared_ptr< MatrixDouble > d_jump, SmartPetscObj< Vec > alpha_vec, boost::shared_ptr< std::map< int, BlockData >> electrode_block_sets_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Protected Attributes

boost::shared_ptr< MatrixDouble > dJumpPtr
 
boost::shared_ptr< std::map< int, BlockData > > elecBlockSetsPtr
 
SmartPetscObj< Vec > petscVec
 

Detailed Description

template<int SPACE_DIM>
struct OpElectrodeCharge< SPACE_DIM >

Definition at line 357 of file electrostatics.hpp.

Constructor & Destructor Documentation

◆ OpElectrodeCharge()

template<int SPACE_DIM>
OpElectrodeCharge< SPACE_DIM >::OpElectrodeCharge ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  d_jump,
SmartPetscObj< Vec >  alpha_vec,
boost::shared_ptr< std::map< int, BlockData >>  electrode_block_sets_ptr 
)
inline

Definition at line 358 of file electrostatics.hpp.

362  : IntEleOp(field_name, IntEleOp::OPROW, false), dJumpPtr(d_jump),
363  petscVec(alpha_vec), elecBlockSetsPtr(electrode_block_sets_ptr) {
364  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
365  doEntities[MBVERTEX] = true;
366  }

Member Function Documentation

◆ doWork()

template<int SPACE_DIM>
MoFEMErrorCode OpElectrodeCharge< SPACE_DIM >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 367 of file electrostatics.hpp.

367  {
370  int index = 0;
371  auto fe_ent = getFEEntityHandle();
372  auto nb_gauss_pts = getGaussPts().size2();
373  double area = getMeasure();
374  dJumpPtr->resize(SPACE_DIM, nb_gauss_pts, false);
375  auto t_jump = getFTensor1FromMat<SPACE_DIM>(*dJumpPtr);
376  auto t_normal = getFTensor1NormalsAtGaussPts();
377  auto t_w = getFTensor0IntegrationWeight();
378  for (auto &m : *elecBlockSetsPtr) {
379  double alphaPart = 0.0;
380  if (m.second.electrodeEnts.find(fe_ent) != m.second.electrodeEnts.end()) {
381 
382  for (int gg = 0; gg != nb_gauss_pts; gg++) {
384  t_r(i) = t_normal(i);
385  auto t_r_normalized = t_r.normalize();
386  alphaPart += (t_jump(i) * t_r(i)) * t_w * area;
387  ++t_jump;
388  ++t_normal;
389  ++t_w;
390  }
391  CHKERR ::VecSetValues(petscVec, 1, &index, &alphaPart,
392  ADD_VALUES); // add the alpha value to the vector
393  }
394  ++index;
395  }
396 
398  }

Member Data Documentation

◆ dJumpPtr

template<int SPACE_DIM>
boost::shared_ptr<MatrixDouble> OpElectrodeCharge< SPACE_DIM >::dJumpPtr
protected

Definition at line 401 of file electrostatics.hpp.

◆ elecBlockSetsPtr

template<int SPACE_DIM>
boost::shared_ptr<std::map<int, BlockData> > OpElectrodeCharge< SPACE_DIM >::elecBlockSetsPtr
protected

Definition at line 402 of file electrostatics.hpp.

◆ petscVec

template<int SPACE_DIM>
SmartPetscObj<Vec> OpElectrodeCharge< SPACE_DIM >::petscVec
protected

Definition at line 403 of file electrostatics.hpp.


The documentation for this struct was generated from the following file:
SPACE_DIM
constexpr int SPACE_DIM
Definition: electrostatics.hpp:10
OpElectrodeCharge::dJumpPtr
boost::shared_ptr< MatrixDouble > dJumpPtr
Definition: electrostatics.hpp:401
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
IntEleOp
IntEle::UserDataOperator IntEleOp
Definition: electrostatics.hpp:17
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', SPACE_DIM >
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
OpElectrodeCharge::petscVec
SmartPetscObj< Vec > petscVec
Definition: electrostatics.hpp:403
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
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
OpElectrodeCharge::elecBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > elecBlockSetsPtr
Definition: electrostatics.hpp:402