v0.13.1
Classes | Typedefs | Functions | Variables
heat_equation.cpp File Reference
#include <stdlib.h>
#include <cmath>
#include <BasicFiniteElements.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  Monitor
 Monitor solution. More...
 
struct  HeatEquation
 

Typedefs

using EntData = EntitiesFieldData::EntData
 [Define dimension] More...
 
using DomainEle = PipelineManager::FaceEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = PipelineManager::EdgeEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab< DomainEle >
 
using OpDomainMass = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 >
 
using OpDomainGradGrad = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM >
 
using OpDomainTimesScalarField = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 >
 
using OpDomainGradTimesVec = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM >
 
using OpDomainSource = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 >
 
using OpBoundaryMass = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 >
 
using OpBoundaryTimeScalarField = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 >
 
using OpBoundarySource = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 >
 

Functions

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

Variables

static char help [] = "...\n\n"
 
constexpr int SPACE_DIM = 2
 [Define dimension] More...
 
constexpr double c = 1
 
constexpr double k = 1
 
constexpr double init_u = 0.
 

Typedef Documentation

◆ BoundaryEle

Definition at line 35 of file heat_equation.cpp.

◆ BoundaryEleOp

Definition at line 36 of file heat_equation.cpp.

◆ DomainEle

Definition at line 33 of file heat_equation.cpp.

◆ DomainEleOp

Definition at line 34 of file heat_equation.cpp.

◆ EntData

[Define dimension]

Examples
heat_equation.cpp.

Definition at line 32 of file heat_equation.cpp.

◆ OpBoundaryMass

using OpBoundaryMass = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, 1>
Examples
heat_equation.cpp.

Definition at line 50 of file heat_equation.cpp.

◆ OpBoundarySource

using OpBoundarySource = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<1, 1>
Examples
heat_equation.cpp.

Definition at line 54 of file heat_equation.cpp.

◆ OpBoundaryTimeScalarField

Examples
heat_equation.cpp.

Definition at line 52 of file heat_equation.cpp.

◆ OpDomainGradGrad

Examples
heat_equation.cpp.

Definition at line 41 of file heat_equation.cpp.

◆ OpDomainGradTimesVec

using OpDomainGradTimesVec = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpGradTimesTensor<1, 1, SPACE_DIM>
Examples
heat_equation.cpp.

Definition at line 45 of file heat_equation.cpp.

◆ OpDomainMass

using OpDomainMass = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, 1>
Examples
heat_equation.cpp.

Definition at line 39 of file heat_equation.cpp.

◆ OpDomainSource

using OpDomainSource = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<1, 1>
Examples
heat_equation.cpp.

Definition at line 47 of file heat_equation.cpp.

◆ OpDomainTimesScalarField

Examples
heat_equation.cpp.

Definition at line 43 of file heat_equation.cpp.

◆ PostProcEle

Definition at line 37 of file heat_equation.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
Examples
heat_equation.cpp.

Definition at line 417 of file heat_equation.cpp.

417 {
418
419 // Initialisation of MoFEM/PETSc and MOAB data structures
420 const char param_file[] = "param_file.petsc";
422
423 // Add logging channel for example
424 auto core_log = logging::core::get();
425 core_log->add_sink(
426 LogManager::createSink(LogManager::getStrmWorld(), "EXAMPLE"));
427 LogManager::setLog("EXAMPLE");
428 MOFEM_LOG_TAG("EXAMPLE", "example")
429
430 // Error handling
431 try {
432 // Register MoFEM discrete manager in PETSc
433 DMType dm_name = "DMMOFEM";
434 CHKERR DMRegister_MoFEM(dm_name);
435
436 // Create MOAB instance
437 moab::Core mb_instance; // mesh database
438 moab::Interface &moab = mb_instance; // mesh database interface
439
440 // Create MoFEM instance
441 MoFEM::Core core(moab); // finite element database
442 MoFEM::Interface &m_field = core; // finite element interface
443
444 // Run the main analysis
445 HeatEquation heat_problem(m_field);
446 CHKERR heat_problem.runProgram();
447 }
449
450 // Finish work: cleaning memory, getting statistics, etc.
452
453 return 0;
454}
std::string param_file
#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
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
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

◆ c

constexpr double c = 1
constexpr
Examples
heat_equation.cpp.

Definition at line 58 of file heat_equation.cpp.

◆ help

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

Definition at line 24 of file heat_equation.cpp.

◆ init_u

constexpr double init_u = 0.
constexpr
Examples
heat_equation.cpp.

Definition at line 60 of file heat_equation.cpp.

◆ k

constexpr double k = 1
constexpr
Examples
heat_equation.cpp.

Definition at line 59 of file heat_equation.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

[Define dimension]

Examples
heat_equation.cpp.

Definition at line 29 of file heat_equation.cpp.