v0.14.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 448 of file nonlinear_poisson_2d.cpp.

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

◆ 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.