v0.16.0
Loading...
Searching...
No Matches
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
 

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 80 of file ConvectiveMassElement.cpp.

84 : VolumeElementForcesAndSourcesCore::UserDataOperator(
86 valuesAtGaussPts(values_at_gauss_pts),
87 gradientAtGaussPts(gardient_at_gauss_pts), zeroAtType(MBVERTEX) {}
constexpr auto field_name
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ doWork()

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

operator calculating deformation gradient

Definition at line 89 of file ConvectiveMassElement.cpp.

90 {
92
93 int nb_dofs = data.getFieldData().size();
94 if (nb_dofs == 0) {
96 }
97 int nb_gauss_pts = data.getN().size1();
98 int nb_base_functions = data.getN().size2();
99
100 // initialize
101 // VectorDouble& values = data.getFieldData();
102 valuesAtGaussPts.resize(nb_gauss_pts);
103 gradientAtGaussPts.resize(nb_gauss_pts);
104 for (int gg = 0; gg < nb_gauss_pts; gg++) {
105 valuesAtGaussPts[gg].resize(3);
106 gradientAtGaussPts[gg].resize(3, 3);
107 }
108
109 if (type == zeroAtType) {
110 for (int gg = 0; gg < nb_gauss_pts; gg++) {
111 valuesAtGaussPts[gg].clear();
112 gradientAtGaussPts[gg].clear();
113 }
114 }
115
116 auto base_function = data.getFTensor0N();
117 auto diff_base_functions = data.getFTensor1DiffN<3>();
118 FTensor::Index<'i', 3> i;
119 FTensor::Index<'j', 3> j;
120
121 for (int gg = 0; gg != nb_gauss_pts; gg++) {
122 auto field_data = data.getFTensor1FieldData<3>();
124 &valuesAtGaussPts[gg][1],
125 &valuesAtGaussPts[gg][2]);
127 &gradientAtGaussPts[gg](0, 0), &gradientAtGaussPts[gg](0, 1),
128 &gradientAtGaussPts[gg](0, 2), &gradientAtGaussPts[gg](1, 0),
129 &gradientAtGaussPts[gg](1, 1), &gradientAtGaussPts[gg](1, 2),
130 &gradientAtGaussPts[gg](2, 0), &gradientAtGaussPts[gg](2, 1),
131 &gradientAtGaussPts[gg](2, 2));
132 int bb = 0;
133 for (; bb != nb_dofs / 3; bb++) {
134 values(i) += base_function * field_data(i);
135 gradient(i, j) += field_data(i) * diff_base_functions(j);
136 ++diff_base_functions;
137 ++base_function;
138 ++field_data;
139 }
140 for (; bb != nb_base_functions; bb++) {
141 ++diff_base_functions;
142 ++base_function;
143 }
144 }
146}
std::string type
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
auto getFTensor1FieldData()
Return FTensor of rank 1, i.e. vector from field data coefficients.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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 DOF values on entity.

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: