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

Inheritance diagram for ConvectiveMassElement::MyVolumeFE:
[legend]
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 22 of file ConvectiveMassElement.cpp.

23 : VolumeElementForcesAndSourcesCore(m_field), A(PETSC_NULL), F(PETSC_NULL) {
24 meshPositionsFieldName = "NoNE";
25
26 auto create_vec = [&]() {
27 constexpr int ghosts[] = {0};
28 if (mField.get_comm_rank() == 0) {
29 return createVectorMPI(mField.get_comm(), 1, 1);
30 } else {
31 return createVectorMPI(mField.get_comm(), 0, 1);
32 }
33 };
34
35 V = create_vec();
36}
auto createVectorMPI(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 38 of file ConvectiveMassElement.cpp.

38{ return 2 * order; };
constexpr int order

◆ postProcess()

MoFEMErrorCode ConvectiveMassElement::MyVolumeFE::postProcess ( )

Definition at line 56 of file ConvectiveMassElement.cpp.

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

◆ preProcess()

MoFEMErrorCode ConvectiveMassElement::MyVolumeFE::preProcess ( )

Definition at line 40 of file ConvectiveMassElement.cpp.

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

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: