v0.15.0
Loading...
Searching...
No Matches
OpElectricField Struct Reference

#include "tutorials/scl-12/src/electrostatics.hpp"

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

Public Member Functions

 OpElectricField (boost::shared_ptr< MatrixDouble > grad_u_negative, boost::shared_ptr< MatrixDouble > grad_u)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Private Attributes

boost::shared_ptr< MatrixDoublegradUNegative
 
boost::shared_ptr< MatrixDoublegradU
 

Detailed Description

Definition at line 406 of file electrostatics.hpp.

Constructor & Destructor Documentation

◆ OpElectricField()

OpElectricField::OpElectricField ( boost::shared_ptr< MatrixDouble > grad_u_negative,
boost::shared_ptr< MatrixDouble > grad_u )
inline

Definition at line 407 of file electrostatics.hpp.

409 : ForcesAndSourcesCore::UserDataOperator(NOSPACE, OPLAST),
410 gradUNegative(grad_u_negative), gradU(grad_u) {}
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< MatrixDouble > gradU
boost::shared_ptr< MatrixDouble > gradUNegative

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpElectricField::doWork ( int side,
EntityType type,
DataForcesAndSourcesCore::EntData & data )
inline

Definition at line 412 of file electrostatics.hpp.

413 {
415
416 const size_t nb_gauss_pts = getGaussPts().size2();
417 gradUNegative->resize(SPACE_DIM, nb_gauss_pts, false);
418 gradUNegative->clear();
419 auto t_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradU);
420 auto t_negative_grad_u = getFTensor1FromMat<SPACE_DIM>(*gradUNegative);
422
423 for (int gg = 0; gg != nb_gauss_pts; gg++) {
424 t_negative_grad_u(I) = -t_grad_u(I);
425 ++t_grad_u;
426 ++t_negative_grad_u;
427 }
428
430 }
#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::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
constexpr IntegrationType I

Member Data Documentation

◆ gradU

boost::shared_ptr<MatrixDouble> OpElectricField::gradU
private

Definition at line 434 of file electrostatics.hpp.

◆ gradUNegative

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

Definition at line 433 of file electrostatics.hpp.


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