v0.15.0
Loading...
Searching...
No Matches
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< MatrixDoubledJumpPtr
 
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 }
IntEle::UserDataOperator IntEleOp
constexpr auto field_name
boost::shared_ptr< std::map< int, BlockData > > elecBlockSetsPtr
SmartPetscObj< Vec > petscVec
boost::shared_ptr< MatrixDouble > dJumpPtr

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);
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 }
Tensor1< T, Tensor_Dim > normalize()
#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()
constexpr int SPACE_DIM
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
FTensor::Index< 'm', 3 > m

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: