v0.13.1
Classes | Typedefs | Functions | Variables
higher_derivatives.cpp File Reference
#include <MoFEM.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  AtomTest
 
struct  AtomTest::CommonData
 Collected data use d by operator to evaluate errors for the test. More...
 
struct  AtomTest::OpError< FIELD_DIM >
 Operator to evaluate errors. More...
 

Typedefs

using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 Finite elenent type. More...
 
using DomainEleOp = DomainEle::UserDataOperator
 Finire element operator type. More...
 
using EntData = EntitiesFieldData::EntData
 Data on entities. More...
 
using OpDomainMass = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< BASE_DIM, FIELD_DIM >
 OPerator to integrate mass matrix for least square approximation. More...
 
using OpDomainSource = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM >
 Operator to integrate the right hand side matrix for the problem. More...
 

Functions

int main (int argc, char *argv[])
 [Check results] More...
 

Variables

static char help [] = "...\n\n"
 
constexpr char FIELD_NAME [] = "U"
 
constexpr int BASE_DIM = 1
 
constexpr int FIELD_DIM = 1
 
constexpr int SPACE_DIM = 2
 
auto fun
 Function to approximate. More...
 
auto diff_fun
 Function derivative. More...
 
auto diff2_fun
 Function second derivative. More...
 

Typedef Documentation

◆ DomainEle

Finite elenent type.

Definition at line 28 of file higher_derivatives.cpp.

◆ DomainEleOp

Finire element operator type.

Definition at line 29 of file higher_derivatives.cpp.

◆ EntData

Data on entities.

Examples
higher_derivatives.cpp.

Definition at line 31 of file higher_derivatives.cpp.

◆ OpDomainMass

OPerator to integrate mass matrix for least square approximation.

Examples
higher_derivatives.cpp.

Definition at line 66 of file higher_derivatives.cpp.

◆ OpDomainSource

using OpDomainSource = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>

Operator to integrate the right hand side matrix for the problem.

Examples
higher_derivatives.cpp.

Definition at line 73 of file higher_derivatives.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Check results]

Examples
higher_derivatives.cpp.

Definition at line 399 of file higher_derivatives.cpp.

399 {
400
401 // Initialisation of MoFEM/PETSc and MOAB data structures
402 MoFEM::Core::Initialize(&argc, &argv, NULL, help);
403
404 try {
405
406 //! [Register MoFEM discrete manager in PETSc]
407 DMType dm_name = "DMMOFEM";
408 CHKERR DMRegister_MoFEM(dm_name);
409 //! [Register MoFEM discrete manager in PETSc
410
411 //! [Create MoAB]
412 moab::Core mb_instance; ///< mesh database
413 moab::Interface &moab = mb_instance; ///< mesh database interface
414 //! [Create MoAB]
415
416 //! [Create MoFEM]
417 MoFEM::Core core(moab); ///< finite element database
418 MoFEM::Interface &m_field = core; ///< finite element database insterface
419 //! [Create MoFEM]
420
421 //! [AtomTest]
422 AtomTest ex(m_field);
423 CHKERR ex.runProblem();
424 //! [AtomTest]
425 }
427
429}
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:47
static char help[]
CoreTmp< 0 > Core
Definition: Core.hpp:1086
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1955
Core (interface) class.
Definition: Core.hpp:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
Deprecated interface functions.

Variable Documentation

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr
Examples
higher_derivatives.cpp.

Definition at line 17 of file higher_derivatives.cpp.

◆ diff2_fun

auto diff2_fun
Initial value:
= [](const double x, const double y, const double z) {
2 + 6 * x + 12 * pow(x, 2), 1.,
1., 2 + 6 * y + 12 * pow(y, 2)};
}

Function second derivative.

Examples
higher_derivatives.cpp.

Definition at line 55 of file higher_derivatives.cpp.

◆ diff_fun

auto diff_fun
Initial value:
= [](const double x, const double y, const double z) {
2 * x + y + 3 * pow(x, 2) + 4 * pow(x, 3),
2 * y + x + 3 * pow(y, 2) + 4 * pow(y, 3)};
}

Function derivative.

Examples
higher_derivatives.cpp.

Definition at line 45 of file higher_derivatives.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr
Examples
higher_derivatives.cpp.

Definition at line 18 of file higher_derivatives.cpp.

◆ FIELD_NAME

constexpr char FIELD_NAME[] = "U"
constexpr
Examples
higher_derivatives.cpp.

Definition at line 16 of file higher_derivatives.cpp.

◆ fun

auto fun
Initial value:
= [](const double x, const double y, const double z) {
return x * x + y * y + x * y + pow(x, 3) + pow(y, 3) + pow(x, 4) + pow(y, 4);
}

Function to approximate.

Examples
PoissonDiscontinousGalerkin.hpp, and higher_derivatives.cpp.

Definition at line 37 of file higher_derivatives.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
higher_derivatives.cpp.

Definition at line 14 of file higher_derivatives.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr
Examples
higher_derivatives.cpp.

Definition at line 19 of file higher_derivatives.cpp.