v0.14.0
Public Member Functions | Public Attributes | List of all members
ConvectiveMassElement::OpVelocityRhs Struct Reference

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

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

Public Member Functions

 OpVelocityRhs (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 301 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ OpVelocityRhs()

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

Definition at line 1007 of file ConvectiveMassElement.cpp.

1010  field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
1011  dAta(data), commonData(common_data) {}

Member Function Documentation

◆ doWork()

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

Definition at line 1013 of file ConvectiveMassElement.cpp.

1014  {
1016 
1017  if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
1018  dAta.tEts.end()) {
1020  }
1021  int nb_dofs = row_data.getIndices().size();
1022  if (nb_dofs == 0)
1024 
1025  auto base = row_data.getFTensor0N();
1026  int nb_base_functions = row_data.getN().size2();
1028 
1029  {
1030 
1031  nf.resize(nb_dofs);
1032  nf.clear();
1033 
1034  for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
1035  FTensor::Tensor1<double *, 3> t_nf(&nf[0], &nf[1], &nf[2], 3);
1037  &commonData.valVel[gg][1],
1038  &commonData.valVel[gg][2]);
1039  int dd = 0;
1040  for (; dd < nb_dofs / 3; dd++) {
1041  t_nf(i) += base * res(i);
1042  ++base;
1043  ++t_nf;
1044  }
1045  for (; dd != nb_base_functions; dd++) {
1046  ++base;
1047  }
1048  }
1049 
1050  if (row_data.getIndices().size() > 3 * row_data.getN().size2()) {
1051  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
1052  }
1053  CHKERR VecSetValues(getFEMethod()->ts_F, row_data.getIndices().size(),
1054  &row_data.getIndices()[0], &nf[0], ADD_VALUES);
1055  }
1057 }

Member Data Documentation

◆ commonData

CommonData& ConvectiveMassElement::OpVelocityRhs::commonData

Definition at line 306 of file ConvectiveMassElement.hpp.

◆ dAta

BlockData& ConvectiveMassElement::OpVelocityRhs::dAta

Definition at line 305 of file ConvectiveMassElement.hpp.

◆ nf

VectorDouble ConvectiveMassElement::OpVelocityRhs::nf

Definition at line 311 of file ConvectiveMassElement.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
ConvectiveMassElement::OpVelocityRhs::commonData
CommonData & commonData
Definition: ConvectiveMassElement.hpp:306
ConvectiveMassElement::BlockData::tEts
Range tEts
elements in block set
Definition: ConvectiveMassElement.hpp:119
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
ConvectiveMassElement::OpVelocityRhs::dAta
BlockData & dAta
Definition: ConvectiveMassElement.hpp:305
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', 3 >
FTensor::dd
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
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
ConvectiveMassElement::OpVelocityRhs::nf
VectorDouble nf
Definition: ConvectiveMassElement.hpp:311
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
ConvectiveMassElement::CommonData::valVel
std::vector< VectorDouble > valVel
Definition: ConvectiveMassElement.hpp:138