v0.16.3
Loading...
Searching...
No Matches
Classes | Functions | Variables
nonlinear_poisson_2d.cpp File Reference
#include <stdlib.h>
#include <MoFEM.hpp>
#include <nonlinear_poisson_2d.hpp>

Go to the source code of this file.

Classes

struct  NonlinearPoisson
 

Functions

double sqr (const double x)
 
double cube (const double x)
 
int main (int argc, char *argv[])
 [Check]
 

Variables

constexpr int SPACE_DIM = 2
 
static char help [] = "...\n\n"
 

Function Documentation

◆ cube()

double cube ( const double  x)
inline

Definition at line 13 of file nonlinear_poisson_2d.cpp.

13{ return x * x * x; }

◆ main()

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

[Check]

Definition at line 452 of file nonlinear_poisson_2d.cpp.

452 {
453
454 // Initialisation of MoFEM/PETSc and MOAB data structures
455 const char param_file[] = "param_file.petsc";
456 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
457
458 auto core_log = logging::core::get();
459 core_log->add_sink(
461 LogManager::setLog("EXAMPLE");
462 MOFEM_LOG_TAG("EXAMPLE", "example")
463
464 // Error handling
465 try {
466 // Register MoFEM discrete manager in PETSc
467 DMType dm_name = "DMMOFEM";
468 CHKERR DMRegister_MoFEM(dm_name);
469
470 // Create MOAB instance
471 moab::Core mb_instance; // mesh database
472 moab::Interface &moab = mb_instance; // mesh database interface
473
474 // Create MoFEM instance
475 MoFEM::Core core(moab); // finite element database
476 MoFEM::Interface &m_field = core; // finite element interface
477
478 // Run the main analysis
479 NonlinearPoisson poisson_problem(m_field);
480 CHKERR poisson_problem.runProgram();
481 }
483
484 // Finish work: cleaning memory, getting statistics, etc.
486
487 return 0;
488}
#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:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
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.

◆ sqr()

double sqr ( const double  x)
inline

Definition at line 11 of file nonlinear_poisson_2d.cpp.

11{ return x * x; }

Variable Documentation

◆ help

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

Definition at line 9 of file nonlinear_poisson_2d.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

Definition at line 8 of file nonlinear_poisson_2d.cpp.