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

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

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

Public Member Functions

 OpGetDataAtGaussPts (const std::string field_name, std::vector< VectorDouble > &values_at_gauss_pts, std::vector< MatrixDouble > &gardient_at_gauss_pts)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 operator calculating deformation gradient More...
 

Public Attributes

std::vector< VectorDouble > & valuesAtGaussPts
 
std::vector< MatrixDouble > & gradientAtGaussPts
 
const EntityType zeroAtType
 

Detailed Description

Definition at line 152 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ OpGetDataAtGaussPts()

ConvectiveMassElement::OpGetDataAtGaussPts::OpGetDataAtGaussPts ( const std::string  field_name,
std::vector< VectorDouble > &  values_at_gauss_pts,
std::vector< MatrixDouble > &  gardient_at_gauss_pts 
)

Definition at line 81 of file ConvectiveMassElement.cpp.

86  field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
87  valuesAtGaussPts(values_at_gauss_pts),
88  gradientAtGaussPts(gardient_at_gauss_pts), zeroAtType(MBVERTEX) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode ConvectiveMassElement::OpGetDataAtGaussPts::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)

operator calculating deformation gradient

Definition at line 90 of file ConvectiveMassElement.cpp.

91  {
93 
94  int nb_dofs = data.getFieldData().size();
95  if (nb_dofs == 0) {
97  }
98  int nb_gauss_pts = data.getN().size1();
99  int nb_base_functions = data.getN().size2();
100 
101  // initialize
102  // VectorDouble& values = data.getFieldData();
103  valuesAtGaussPts.resize(nb_gauss_pts);
104  gradientAtGaussPts.resize(nb_gauss_pts);
105  for (int gg = 0; gg < nb_gauss_pts; gg++) {
106  valuesAtGaussPts[gg].resize(3);
107  gradientAtGaussPts[gg].resize(3, 3);
108  }
109 
110  if (type == zeroAtType) {
111  for (int gg = 0; gg < nb_gauss_pts; gg++) {
112  valuesAtGaussPts[gg].clear();
113  gradientAtGaussPts[gg].clear();
114  }
115  }
116 
117  auto base_function = data.getFTensor0N();
118  auto diff_base_functions = data.getFTensor1DiffN<3>();
121 
122  for (int gg = 0; gg != nb_gauss_pts; gg++) {
123  auto field_data = data.getFTensor1FieldData<3>();
125  &valuesAtGaussPts[gg][1],
126  &valuesAtGaussPts[gg][2]);
128  &gradientAtGaussPts[gg](0, 0), &gradientAtGaussPts[gg](0, 1),
129  &gradientAtGaussPts[gg](0, 2), &gradientAtGaussPts[gg](1, 0),
130  &gradientAtGaussPts[gg](1, 1), &gradientAtGaussPts[gg](1, 2),
131  &gradientAtGaussPts[gg](2, 0), &gradientAtGaussPts[gg](2, 1),
132  &gradientAtGaussPts[gg](2, 2));
133  int bb = 0;
134  for (; bb != nb_dofs / 3; bb++) {
135  values(i) += base_function * field_data(i);
136  gradient(i, j) += field_data(i) * diff_base_functions(j);
137  ++diff_base_functions;
138  ++base_function;
139  ++field_data;
140  }
141  for (; bb != nb_base_functions; bb++) {
142  ++diff_base_functions;
143  ++base_function;
144  }
145  }
147 }

Member Data Documentation

◆ gradientAtGaussPts

std::vector<MatrixDouble>& ConvectiveMassElement::OpGetDataAtGaussPts::gradientAtGaussPts

Definition at line 156 of file ConvectiveMassElement.hpp.

◆ valuesAtGaussPts

std::vector<VectorDouble>& ConvectiveMassElement::OpGetDataAtGaussPts::valuesAtGaussPts

Definition at line 155 of file ConvectiveMassElement.hpp.

◆ zeroAtType

const EntityType ConvectiveMassElement::OpGetDataAtGaussPts::zeroAtType

Definition at line 157 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
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1254
FTensor::Tensor2< double *, 3, 3 >
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
convert.type
type
Definition: convert.py:64
ConvectiveMassElement::OpGetDataAtGaussPts::zeroAtType
const EntityType zeroAtType
Definition: ConvectiveMassElement.hpp:157
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 >
ConvectiveMassElement::OpGetDataAtGaussPts::gradientAtGaussPts
std::vector< MatrixDouble > & gradientAtGaussPts
Definition: ConvectiveMassElement.hpp:156
ConvectiveMassElement::OpGetDataAtGaussPts::valuesAtGaussPts
std::vector< VectorDouble > & valuesAtGaussPts
Definition: ConvectiveMassElement.hpp:155
MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
Definition: EntitiesFieldData.cpp:526
MoFEM::EntitiesFieldData::EntData::getFTensor1FieldData
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1FieldData()
Return FTensor of rank 1, i.e. vector from filed data coefficients.
Definition: EntitiesFieldData.hpp:1288
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
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453