v0.13.1
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 83 of file ConvectiveMassElement.cpp.

88 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
89 valuesAtGaussPts(values_at_gauss_pts),
90 gradientAtGaussPts(gardient_at_gauss_pts), zeroAtType(MBVERTEX) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator
constexpr auto field_name

Member Function Documentation

◆ doWork()

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

operator calculating deformation gradient

Definition at line 92 of file ConvectiveMassElement.cpp.

93 {
95
96 int nb_dofs = data.getFieldData().size();
97 if (nb_dofs == 0) {
99 }
100 int nb_gauss_pts = data.getN().size1();
101 int nb_base_functions = data.getN().size2();
102
103 // initialize
104 // VectorDouble& values = data.getFieldData();
105 valuesAtGaussPts.resize(nb_gauss_pts);
106 gradientAtGaussPts.resize(nb_gauss_pts);
107 for (int gg = 0; gg < nb_gauss_pts; gg++) {
108 valuesAtGaussPts[gg].resize(3);
109 gradientAtGaussPts[gg].resize(3, 3);
110 }
111
112 if (type == zeroAtType) {
113 for (int gg = 0; gg < nb_gauss_pts; gg++) {
114 valuesAtGaussPts[gg].clear();
115 gradientAtGaussPts[gg].clear();
116 }
117 }
118
119 auto base_function = data.getFTensor0N();
120 auto diff_base_functions = data.getFTensor1DiffN<3>();
123
124 for (int gg = 0; gg != nb_gauss_pts; gg++) {
125 auto field_data = data.getFTensor1FieldData<3>();
127 &valuesAtGaussPts[gg][1],
128 &valuesAtGaussPts[gg][2]);
130 &gradientAtGaussPts[gg](0, 0), &gradientAtGaussPts[gg](0, 1),
131 &gradientAtGaussPts[gg](0, 2), &gradientAtGaussPts[gg](1, 0),
132 &gradientAtGaussPts[gg](1, 1), &gradientAtGaussPts[gg](1, 2),
133 &gradientAtGaussPts[gg](2, 0), &gradientAtGaussPts[gg](2, 1),
134 &gradientAtGaussPts[gg](2, 2));
135 int bb = 0;
136 for (; bb != nb_dofs / 3; bb++) {
137 values(i) += base_function * field_data(i);
138 gradient(i, j) += field_data(i) * diff_base_functions(j);
139 ++diff_base_functions;
140 ++base_function;
141 ++field_data;
142 }
143 for (; bb != nb_base_functions; bb++) {
144 ++diff_base_functions;
145 ++base_function;
146 }
147 }
149}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#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
FTensor::Index< 'j', 3 > j
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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 VectorDouble & getFieldData() const
get dofs values
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1FieldData()
Return FTensor of rank 1, i.e. vector from filed data coeffinects.

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: