v0.13.1
Public Member Functions | Public Attributes | List of all members
ConvectiveMassElement::MyVolumeFE Struct Reference

definition of volume element More...

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

Inherits VolumeElementForcesAndSourcesCore.

Collaboration diagram for ConvectiveMassElement::MyVolumeFE:
[legend]

Public Member Functions

 MyVolumeFE (MoFEM::Interface &m_field)
 
int getRule (int order)
 it is used to calculate nb. of Gauss integration points More...
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode postProcess ()
 

Public Attributes

Mat A
 
Vec F
 
SmartPetscObj< Vec > V
 
double eNergy
 

Detailed Description

definition of volume element

Examples
nonlinear_dynamics.cpp.

Definition at line 31 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ MyVolumeFE()

ConvectiveMassElement::MyVolumeFE::MyVolumeFE ( MoFEM::Interface m_field)

Definition at line 24 of file ConvectiveMassElement.cpp.

25 : VolumeElementForcesAndSourcesCore(m_field), A(PETSC_NULL), F(PETSC_NULL) {
26 meshPositionsFieldName = "NoNE";
27
28 auto create_vec = [&]() {
29 constexpr int ghosts[] = {0};
30 if (mField.get_comm_rank() == 0) {
32 } else {
33 return createSmartVectorMPI(mField.get_comm(), 0, 1);
34 }
35 };
36
37 V = create_vec();
38}
auto createSmartVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0

Member Function Documentation

◆ getRule()

int ConvectiveMassElement::MyVolumeFE::getRule ( int  order)

it is used to calculate nb. of Gauss integration points

for more details pleas look Reference:

Albert Nijenhuis, Herbert Wilf, Combinatorial Algorithms for Computers and Calculators, Second Edition, Academic Press, 1978, ISBN: 0-12-519260-6, LC: QA164.N54.

More details about algorithm http://people.sc.fsu.edu/~jburkardt/cpp_src/gm_rule/gm_rule.html

Definition at line 40 of file ConvectiveMassElement.cpp.

40{ return 2 * order; };

◆ postProcess()

MoFEMErrorCode ConvectiveMassElement::MyVolumeFE::postProcess ( )

Definition at line 58 of file ConvectiveMassElement.cpp.

58 {
60
61 CHKERR VolumeElementForcesAndSourcesCore::postProcess();
62
63 const double *array;
64 switch (ts_ctx) {
65 case CTX_TSNONE:
66 CHKERR VecAssemblyBegin(V);
67 CHKERR VecAssemblyEnd(V);
68 CHKERR VecSum(V, &eNergy);
69 break;
70 default:
71 break;
72 }
73
75}
#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

◆ preProcess()

MoFEMErrorCode ConvectiveMassElement::MyVolumeFE::preProcess ( )

Definition at line 42 of file ConvectiveMassElement.cpp.

42 {
44
45 CHKERR VolumeElementForcesAndSourcesCore::preProcess();
46
47 switch (ts_ctx) {
48 case CTX_TSNONE:
49 CHKERR VecZeroEntries(V);
50 break;
51 default:
52 break;
53 }
54
56}

Member Data Documentation

◆ A

Mat ConvectiveMassElement::MyVolumeFE::A

Definition at line 33 of file ConvectiveMassElement.hpp.

◆ eNergy

double ConvectiveMassElement::MyVolumeFE::eNergy
Examples
nonlinear_dynamics.cpp.

Definition at line 56 of file ConvectiveMassElement.hpp.

◆ F

Vec ConvectiveMassElement::MyVolumeFE::F

Definition at line 34 of file ConvectiveMassElement.hpp.

◆ V

SmartPetscObj<Vec> ConvectiveMassElement::MyVolumeFE::V

Definition at line 55 of file ConvectiveMassElement.hpp.


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