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

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

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

Public Member Functions

 OpEnergy (const std::string field_name, BlockData &data, CommonData &common_data, SmartPetscObj< Vec > v)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 

Public Attributes

BlockDatadAta
 
CommonDatacommonData
 
SmartPetscObj< Vec > V
 
boollInear
 
MatrixDouble3by3 h
 
MatrixDouble3by3 H
 
MatrixDouble3by3 invH
 
MatrixDouble3by3 F
 
VectorDouble3 v
 

Detailed Description

Definition at line 261 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ OpEnergy()

ConvectiveMassElement::OpEnergy::OpEnergy ( const std::string  field_name,
BlockData data,
CommonData common_data,
SmartPetscObj< Vec >  v 
)

Definition at line 727 of file ConvectiveMassElement.cpp.

731 : VolumeElementForcesAndSourcesCore::UserDataOperator(
732 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
733 dAta(data), commonData(common_data), V(v, true),
constexpr auto field_name

Member Function Documentation

◆ doWork()

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

Definition at line 737 of file ConvectiveMassElement.cpp.

738 {
740
741 if (row_type != MBVERTEX) {
743 }
744 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
745 dAta.tEts.end()) {
747 }
748
749 {
750 double energy = 0;
751 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
752 double val = getVolume() * getGaussPts()(3, gg);
753 double rho0 = dAta.rho0;
754 double rho;
755 if (lInear) {
756 rho = rho0;
757 } else {
758 h.resize(3, 3);
759 noalias(h) =
762 .size() > 0) {
763 H.resize(3, 3);
764 noalias(H) =
766 auto detH = determinantTensor3by3(H);
767 invH.resize(3, 3);
769 F.resize(3, 3);
770 noalias(F) = prod(h, invH);
771 } else {
772 F.resize(3, 3);
773 noalias(F) = h;
774 }
775 double detF = determinantTensor3by3(F);
776 rho = detF * rho0;
777 }
778 v.resize(3);
780 energy += 0.5 * (rho * val) * inner_prod(v, v);
781 }
782 CHKERR VecSetValue(V, 0, energy, ADD_VALUES);
783 }
784
786}
#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
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
Definition: Templates.hpp:1363
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1352
double rho
Definition: plastic.cpp:101
std::map< std::string, std::vector< VectorDouble > > dataAtGaussPts
std::map< std::string, std::vector< MatrixDouble > > gradAtGaussPts
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

Member Data Documentation

◆ commonData

CommonData& ConvectiveMassElement::OpEnergy::commonData

Definition at line 265 of file ConvectiveMassElement.hpp.

◆ dAta

BlockData& ConvectiveMassElement::OpEnergy::dAta

Definition at line 264 of file ConvectiveMassElement.hpp.

◆ F

MatrixDouble3by3 ConvectiveMassElement::OpEnergy::F

Definition at line 272 of file ConvectiveMassElement.hpp.

◆ h

MatrixDouble3by3 ConvectiveMassElement::OpEnergy::h

Definition at line 272 of file ConvectiveMassElement.hpp.

◆ H

MatrixDouble3by3 ConvectiveMassElement::OpEnergy::H

Definition at line 272 of file ConvectiveMassElement.hpp.

◆ invH

MatrixDouble3by3 ConvectiveMassElement::OpEnergy::invH

Definition at line 272 of file ConvectiveMassElement.hpp.

◆ lInear

bool& ConvectiveMassElement::OpEnergy::lInear

Definition at line 267 of file ConvectiveMassElement.hpp.

◆ V

SmartPetscObj<Vec> ConvectiveMassElement::OpEnergy::V

Definition at line 266 of file ConvectiveMassElement.hpp.

◆ v

VectorDouble3 ConvectiveMassElement::OpEnergy::v

Definition at line 273 of file ConvectiveMassElement.hpp.


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