v0.15.0
Loading...
Searching...
No Matches
OpVolDivergence Struct Reference
Inheritance diagram for OpVolDivergence:
[legend]
Collaboration diagram for OpVolDivergence:
[legend]

Public Member Functions

 OpVolDivergence (double &div)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Public Attributes

doubledIv
 

Detailed Description

Examples
hdiv_divergence_operator.cpp.

Definition at line 18 of file hdiv_divergence_operator.cpp.

Constructor & Destructor Documentation

◆ OpVolDivergence()

OpVolDivergence::OpVolDivergence ( double & div)
inline
Examples
hdiv_divergence_operator.cpp.

Definition at line 22 of file hdiv_divergence_operator.cpp.

23 : VolumeElementForcesAndSourcesCore::UserDataOperator(
24 "HDIV", UserDataOperator::OPROW),
25 dIv(div) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpVolDivergence::doWork ( int side,
EntityType type,
EntitiesFieldData::EntData & data )
Examples
hdiv_divergence_operator.cpp.

Definition at line 178 of file hdiv_divergence_operator.cpp.

179 {
181
182 if (CN::Dimension(type) < 2)
184
185 if (data.getFieldData().size() == 0)
187
188 int nb_gauss_pts = data.getDiffN().size1();
189 int nb_dofs = data.getFieldData().size();
190
191 VectorDouble div_vec;
192 div_vec.resize(nb_dofs, 0);
193
194 FTensor::Index<'i', 3> i;
195 auto t_base_diff_hdiv = data.getFTensor2DiffN<3, 3>();
196
197 for (size_t gg = 0; gg < nb_gauss_pts; gg++) {
198 for (size_t dd = 0; dd != div_vec.size(); dd++) {
199 double w = getGaussPts()(3, gg) * getVolume();
200 dIv += t_base_diff_hdiv(i, i) * w;
201 ++t_base_diff_hdiv;
202 }
203 }
204
206}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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()
FTensor::Index< 'i', SPACE_DIM > i
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition ddTensor0.hpp:33
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN(FieldApproximationBase base)
Get derivatives of base functions for Hdiv space.
MatrixDouble & getDiffN(const FieldApproximationBase base)
get derivatives of base functions
const VectorDouble & getFieldData() const
get dofs values

Member Data Documentation

◆ dIv

double& OpVolDivergence::dIv
Examples
hdiv_divergence_operator.cpp.

Definition at line 21 of file hdiv_divergence_operator.cpp.


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