v0.14.0
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] More...
 

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(
456  LogManager::createSink(LogManager::getStrmWorld(), "EXAMPLE"));
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  }
478  CATCH_ERRORS;
479 
480  // Finish work: cleaning memory, getting statistics, etc.
482 
483  return 0;
484 }

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

MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
NonlinearPoisson
Definition: nonlinear_poisson_2d.cpp:15
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
help
static char help[]
Definition: nonlinear_poisson_2d.cpp:9
MoFEM::CoreTmp< 0 >::Initialize
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
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148