v0.15.0
Loading...
Searching...
No Matches
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 450 of file nonlinear_poisson_2d.cpp.

450 {
451
452 // Initialisation of MoFEM/PETSc and MOAB data structures
453 const char param_file[] = "param_file.petsc";
454 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
455
456 auto core_log = logging::core::get();
457 core_log->add_sink(
459 LogManager::setLog("EXAMPLE");
460 MOFEM_LOG_TAG("EXAMPLE", "example")
461
462 // Error handling
463 try {
464 // Register MoFEM discrete manager in PETSc
465 DMType dm_name = "DMMOFEM";
466 CHKERR DMRegister_MoFEM(dm_name);
467
468 // Create MOAB instance
469 moab::Core mb_instance; // mesh database
470 moab::Interface &moab = mb_instance; // mesh database interface
471
472 // Create MoFEM instance
473 MoFEM::Core core(moab); // finite element database
474 MoFEM::Interface &m_field = core; // finite element interface
475
476 // Run the main analysis
477 NonlinearPoisson poisson_problem(m_field);
478 CHKERR poisson_problem.runProgram();
479 }
481
482 // Finish work: cleaning memory, getting statistics, etc.
484
485 return 0;
486}
#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:118
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

int SPACE_DIM = 2
constexpr

Definition at line 8 of file nonlinear_poisson_2d.cpp.