v0.13.1
Public Member Functions | Private Attributes | List of all members
PoissonOps::OpRhsU Struct Reference

#include <users_modules/softmech/poisson_problem/src/PoissonOperators.hpp>

Inheritance diagram for PoissonOps::OpRhsU:
[legend]
Collaboration diagram for PoissonOps::OpRhsU:
[legend]

Public Member Functions

 OpRhsU (std::string domain_field)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

VectorDouble locRhs
 

Detailed Description

Definition at line 76 of file PoissonOperators.hpp.

Constructor & Destructor Documentation

◆ OpRhsU()

PoissonOps::OpRhsU::OpRhsU ( std::string  domain_field)

Definition at line 78 of file PoissonOperators.hpp.

78: OpVolEle(domain_field, OpVolEle::OPROW) {}
FaceElementForcesAndSourcesCore::UserDataOperator OpVolEle
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ doWork()

MoFEMErrorCode PoissonOps::OpRhsU::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 79 of file PoissonOperators.hpp.

79 {
81
82 const int nb_dofs = data.getIndices().size();
83 if (nb_dofs) {
84 locRhs.resize(nb_dofs, false);
85 locRhs.clear();
86 const int nb_integration_pts = getGaussPts().size2();
87
88 auto t_base = data.getFTensor0N();
89 auto t_w = getFTensor0IntegrationWeight();
90 const double vol = getMeasure();
91 for (int gg = 0; gg != nb_integration_pts; ++gg) {
92 const double a = vol * t_w;
93
94 for (int rr = 0; rr != nb_dofs; ++rr) {
95 locRhs[rr] += a * (t_base * body_source);
96 ++t_base;
97 } // endFor rr
98 ++t_w;
99 } // endFor gg
100 CHKERR VecSetOption(getFEMethod()->ksp_f, VEC_IGNORE_NEGATIVE_INDICES,
101 PETSC_TRUE);
102 CHKERR VecSetValues(getFEMethod()->ksp_f, data, &*locRhs.begin(),
103 ADD_VALUES);
104 } // endIf (nb_dofs)
105
107 }
constexpr double a
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
const double body_source
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ locRhs

VectorDouble PoissonOps::OpRhsU::locRhs
private

Definition at line 110 of file PoissonOperators.hpp.


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