v0.14.0
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
 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 30 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 67 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 74 of file higher_derivatives.cpp.

Function Documentation

◆ main()

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

[Check results]

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database insterface

[Create MoFEM]

[AtomTest]

[AtomTest]

Examples
higher_derivatives.cpp.

Definition at line 397 of file higher_derivatives.cpp.

397  {
398 
399  // Initialisation of MoFEM/PETSc and MOAB data structures
400  MoFEM::Core::Initialize(&argc, &argv, NULL, help);
401 
402  try {
403 
404  //! [Register MoFEM discrete manager in PETSc]
405  DMType dm_name = "DMMOFEM";
406  CHKERR DMRegister_MoFEM(dm_name);
407  //! [Register MoFEM discrete manager in PETSc
408 
409  //! [Create MoAB]
410  moab::Core mb_instance; ///< mesh database
411  moab::Interface &moab = mb_instance; ///< mesh database interface
412  //! [Create MoAB]
413 
414  //! [Create MoFEM]
415  MoFEM::Core core(moab); ///< finite element database
416  MoFEM::Interface &m_field = core; ///< finite element database insterface
417  //! [Create MoFEM]
418 
419  //! [AtomTest]
420  AtomTest ex(m_field);
421  CHKERR ex.runProblem();
422  //! [AtomTest]
423  }
424  CATCH_ERRORS;
425 
427 }

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, prism_polynomial_approximation.cpp, and quad_polynomial_approximation.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
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.

AtomTest
Definition: child_and_parent.cpp:57
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
MoFEM::CoreTmp< 0 >::Initialize
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
help
static char help[]
Definition: higher_derivatives.cpp:14
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094