v0.15.0
Loading...
Searching...
No Matches
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 728 of file ConvectiveMassElement.cpp.

732 : VolumeElementForcesAndSourcesCore::UserDataOperator(
733 field_name, ForcesAndSourcesCore::UserDataOperator::OPROW),
734 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 738 of file ConvectiveMassElement.cpp.

739 {
741
742 if (row_type != MBVERTEX) {
744 }
745 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
746 dAta.tEts.end()) {
748 }
749
750 {
751 double energy = 0;
752 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
753 double val = getVolume() * getGaussPts()(3, gg);
754 double rho0 = dAta.rho0;
755 double rho;
756 if (lInear) {
757 rho = rho0;
758 } else {
759 h.resize(3, 3);
760 noalias(h) =
763 .size() > 0) {
764 H.resize(3, 3);
765 noalias(H) =
767 auto detH = determinantTensor3by3(H);
768 invH.resize(3, 3);
770 F.resize(3, 3);
771 noalias(F) = prod(h, invH);
772 } else {
773 F.resize(3, 3);
774 noalias(F) = h;
775 }
776 double detF = determinantTensor3by3(F);
777 rho = detF * rho0;
778 }
779 v.resize(3);
781 energy += 0.5 * (rho * val) * inner_prod(v, v);
782 }
783 CHKERR VecSetValue(V, 0, energy, ADD_VALUES);
784 }
785
787}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
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.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
double rho
Definition plastic.cpp:144
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: