v0.14.0
Public Member Functions | Private Attributes | List of all members
OpGradTimesPerm Struct Reference

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

Inheritance diagram for OpGradTimesPerm:
[legend]
Collaboration diagram for OpGradTimesPerm:
[legend]

Public Member Functions

 OpGradTimesPerm (const std::string &field_name, boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< MatrixDouble > grad_times_perm, boost::shared_ptr< std::map< int, BlockData >> perm_block_sets_ptr, boost::shared_ptr< DataAtIntegrationPts > common_data_ptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< MatrixDouble > gradUNegative
 
boost::shared_ptr< MatrixDouble > gradTimesPerm
 
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
 
boost::shared_ptr< DataAtIntegrationPtscommonDataPtr
 

Detailed Description

Definition at line 247 of file electrostatics.hpp.

Constructor & Destructor Documentation

◆ OpGradTimesPerm()

OpGradTimesPerm::OpGradTimesPerm ( const std::string &  field_name,
boost::shared_ptr< MatrixDouble >  grad_u_negative,
boost::shared_ptr< MatrixDouble >  grad_times_perm,
boost::shared_ptr< std::map< int, BlockData >>  perm_block_sets_ptr,
boost::shared_ptr< DataAtIntegrationPts common_data_ptr 
)
inline

Definition at line 249 of file electrostatics.hpp.

255  : DomainEleOp(field_name, field_name, OPROWCOL, false),
256  gradTimesPerm(grad_times_perm), gradUNegative(grad_u_negative),
257  permBlockSetsPtr(perm_block_sets_ptr), commonDataPtr(common_data_ptr) {
258  std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
259  doEntities[MBVERTEX] = true;
260  }

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpGradTimesPerm::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
inline

Definition at line 262 of file electrostatics.hpp.

265  {
267 
268  size_t nb_gauss_pts = getGaussPts().size2();
269  gradTimesPerm->resize(SPACE_DIM, nb_gauss_pts, false);
270  gradTimesPerm->clear();
271  auto t_grad_times_perm = getFTensor1FromMat<SPACE_DIM>(*gradTimesPerm);
272  auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
274  double blockPermittivity = 0.0;
275  for (const auto &n : *permBlockSetsPtr) {
276  if (n.second.domainEnts.find(getFEEntityHandle()) !=
277  n.second.domainEnts.end()) {
278  blockPermittivity = n.second.epsPermit;
279  }
280  }
281  for (int gg = 0; gg != nb_gauss_pts; gg++) {
282  t_grad_times_perm(I) = t_negative_grad_u(I) * blockPermittivity;
283 
284  ++t_negative_grad_u;
285  ++t_grad_times_perm;
286  }
287 
289  }

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<DataAtIntegrationPts> OpGradTimesPerm::commonDataPtr
private

Definition at line 295 of file electrostatics.hpp.

◆ gradTimesPerm

boost::shared_ptr<MatrixDouble> OpGradTimesPerm::gradTimesPerm
private

Definition at line 293 of file electrostatics.hpp.

◆ gradUNegative

boost::shared_ptr<MatrixDouble> OpGradTimesPerm::gradUNegative
private

Definition at line 292 of file electrostatics.hpp.

◆ permBlockSetsPtr

boost::shared_ptr<std::map<int, BlockData> > OpGradTimesPerm::permBlockSetsPtr
private

Definition at line 294 of file electrostatics.hpp.


The documentation for this struct was generated from the following file:
OpGradTimesPerm::commonDataPtr
boost::shared_ptr< DataAtIntegrationPts > commonDataPtr
Definition: electrostatics.hpp:295
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Definition: electrostatics.hpp:16
SPACE_DIM
constexpr int SPACE_DIM
Definition: electrostatics.hpp:10
OpGradTimesPerm::gradTimesPerm
boost::shared_ptr< MatrixDouble > gradTimesPerm
Definition: electrostatics.hpp:293
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
convert.n
n
Definition: convert.py:82
OpGradTimesPerm::gradUNegative
boost::shared_ptr< MatrixDouble > gradUNegative
Definition: electrostatics.hpp:292
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
OpGradTimesPerm::permBlockSetsPtr
boost::shared_ptr< std::map< int, BlockData > > permBlockSetsPtr
Definition: electrostatics.hpp:294
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359