v0.14.0
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 }

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; };

◆ 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 }

◆ 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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
ConvectiveMassElement::MyVolumeFE::eNergy
double eNergy
Definition: ConvectiveMassElement.hpp:56
MoFEM::CoreInterface::get_comm_rank
virtual int get_comm_rank() const =0
ts_ctx
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1932
order
constexpr int order
Definition: dg_projection.cpp:18
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
ConvectiveMassElement::MyVolumeFE::F
Vec F
Definition: ConvectiveMassElement.hpp:34
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
ConvectiveMassElement::MyVolumeFE::V
SmartPetscObj< Vec > V
Definition: ConvectiveMassElement.hpp:55
MoFEM::createVectorMPI
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
Definition: PetscSmartObj.hpp:198
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
ConvectiveMassElement::mField
MoFEM::Interface & mField
Definition: ConvectiveMassElement.hpp:108
ConvectiveMassElement::MyVolumeFE::A
Mat A
Definition: ConvectiveMassElement.hpp:33