v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ConvectiveMassElement::OpMassRhs Struct Reference

#include <users_modules/basic_finite_elements/src/ConvectiveMassElement.hpp>

Inheritance diagram for ConvectiveMassElement::OpMassRhs:
[legend]
Collaboration diagram for ConvectiveMassElement::OpMassRhs:
[legend]

Public Member Functions

 OpMassRhs (const std::string field_name, BlockData &data, CommonData &common_data)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 

Public Attributes

BlockDatadAta
 
CommonDatacommonData
 
VectorDouble nf
 

Detailed Description

Definition at line 207 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ OpMassRhs()

ConvectiveMassElement::OpMassRhs::OpMassRhs ( const std::string  field_name,
BlockData data,
CommonData common_data 
)

Definition at line 383 of file ConvectiveMassElement.cpp.

386 : VolumeElementForcesAndSourcesCore::UserDataOperator(
387 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
388 dAta(data), commonData(common_data) {}
constexpr auto field_name

Member Function Documentation

◆ doWork()

MoFEMErrorCode ConvectiveMassElement::OpMassRhs::doWork ( int  row_side,
EntityType  row_type,
EntitiesFieldData::EntData row_data 
)

Definition at line 391 of file ConvectiveMassElement.cpp.

392 {
394
395 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
396 dAta.tEts.end()) {
398 }
399 if (row_data.getIndices().size() == 0)
401 int nb_dofs = row_data.getIndices().size();
402
403 auto base = row_data.getFTensor0N();
404 int nb_base_functions = row_data.getN().size2();
405
406 {
407
408 nf.resize(nb_dofs);
409 nf.clear();
410
412
413 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
414 FTensor::Tensor1<double *, 3> t_nf(&nf[0], &nf[1], &nf[2], 3);
416 &commonData.valMass[gg][1],
417 &commonData.valMass[gg][2]);
418 int dd = 0;
419 for (; dd < nb_dofs / 3; dd++) {
420 t_nf(i) += base * res(i);
421 ++base;
422 ++t_nf;
423 }
424 for (; dd != nb_base_functions; dd++) {
425 ++base;
426 }
427 }
428
429 if ((unsigned int)nb_dofs > 3 * row_data.getN().size2()) {
430 SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
431 }
432 CHKERR VecSetValues(getFEMethod()->ts_F, nb_dofs, &row_data.getIndices()[0],
433 &nf[0], ADD_VALUES);
434 }
435
437}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define CHKERR
Inline error check.
Definition: definitions.h:535
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
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
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonData

CommonData& ConvectiveMassElement::OpMassRhs::commonData

Definition at line 211 of file ConvectiveMassElement.hpp.

◆ dAta

BlockData& ConvectiveMassElement::OpMassRhs::dAta

Definition at line 210 of file ConvectiveMassElement.hpp.

◆ nf

VectorDouble ConvectiveMassElement::OpMassRhs::nf

Definition at line 216 of file ConvectiveMassElement.hpp.


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