v0.14.0
Loading...
Searching...
No Matches
heat_equation.cpp File Reference
#include <stdlib.h>
#include <cmath>
#include <MoFEM.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  Monitor
 [Push operators to pipeline] More...
 
struct  HeatEquation
 
struct  CalcJacobian
 

Typedefs

using PostProcEle = PostProcBrokenMeshInMoab<DomainEle>
 
using OpDomainMass
 
using OpDomainGradGrad
 
using OpDomainTimesScalarField
 
using OpDomainGradTimesVec
 
using OpDomainSource
 
using OpBoundaryMass
 
using OpBoundaryTimeScalarField
 
using OpBoundarySource
 

Functions

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

Variables

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

Typedef Documentation

◆ OpBoundaryMass

◆ OpBoundarySource

◆ OpBoundaryTimeScalarField

◆ OpDomainGradGrad

Initial value:
Examples
heat_equation.cpp.

Definition at line 39 of file heat_equation.cpp.

◆ OpDomainGradTimesVec

◆ OpDomainMass

◆ OpDomainSource

◆ OpDomainTimesScalarField

◆ PostProcEle

Definition at line 35 of file heat_equation.cpp.

Function Documentation

◆ main()

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

Definition at line 439 of file heat_equation.cpp.

439 {
440
441 // Initialisation of MoFEM/PETSc and MOAB data structures
442 const char param_file[] = "param_file.petsc";
443 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
444
445 // Add logging channel for example
446 auto core_log = logging::core::get();
447 core_log->add_sink(
449 LogManager::setLog("EXAMPLE");
450 MOFEM_LOG_TAG("EXAMPLE", "example")
451
452 // Error handling
453 try {
454 // Register MoFEM discrete manager in PETSc
455 DMType dm_name = "DMMOFEM";
456 CHKERR DMRegister_MoFEM(dm_name);
457
458 // Create MOAB instance
459 moab::Core mb_instance; // mesh database
460 moab::Interface &moab = mb_instance; // mesh database interface
461
462 // Create MoFEM instance
463 MoFEM::Core core(moab); // finite element database
464 MoFEM::Interface &m_field = core; // finite element interface
465
466 // Run the main analysis
467 HeatEquation heat_problem(m_field);
468 CHKERR heat_problem.runProgram();
469 }
471
472 // Finish work: cleaning memory, getting statistics, etc.
474
475 return 0;
476}
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
static char help[]
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.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.

Variable Documentation

◆ c

double c = 1
constexpr
Examples
heat_equation.cpp.

Definition at line 56 of file heat_equation.cpp.

◆ help

char help[] = "...\n\n"
static

Definition at line 22 of file heat_equation.cpp.

◆ init_u

double init_u = 0.
constexpr
Examples
heat_equation.cpp, and shallow_wave.cpp.

Definition at line 58 of file heat_equation.cpp.

◆ k

double k = 1
constexpr
Examples
heat_equation.cpp.

Definition at line 57 of file heat_equation.cpp.

◆ SPACE_DIM

int SPACE_DIM = 2
constexpr

[Define dimension]

Definition at line 27 of file heat_equation.cpp.