v0.16.0
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 
)

Member Function Documentation

◆ doWork()

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

Definition at line 739 of file ConvectiveMassElement.cpp.

740 {
742
743 if (row_type != MBVERTEX) {
745 }
746 if (dAta.tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
747 dAta.tEts.end()) {
749 }
750
751 {
752 double energy = 0;
753 for (unsigned int gg = 0; gg < row_data.getN().size1(); gg++) {
754 double val = getVolume() * getGaussPts()(3, gg);
755 double rho0 = dAta.rho0;
756 double rho;
757 if (lInear) {
758 rho = rho0;
759 } else {
760 h.resize(3, 3);
761 noalias(h) =
764 .size() > 0) {
765 H.resize(3, 3);
766 noalias(H) =
768 auto detH = determinantTensor3by3(H);
769 invH.resize(3, 3);
771 F.resize(3, 3);
772 noalias(F) = prod(h, invH);
773 } else {
774 F.resize(3, 3);
775 noalias(F) = h;
776 }
777 double detF = determinantTensor3by3(F);
778 rho = detF * rho0;
779 }
780 v.resize(3);
782 energy += 0.5 * (rho * val) * inner_prod(v, v);
783 }
784 CHKERR VecSetValue(V, 0, energy, ADD_VALUES);
785 }
786
788}
#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.
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....
double rho
Definition plastic.cpp:145

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: