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

Go to the source code of this file.

Classes

struct  StandardPoisson
 
struct  StandardPoisson::CommonData
 [Source function] More...
 
struct  StandardPoisson::OpError
 

Typedefs

using PostProcFaceEle
 
using OpDomainGradGrad
 
using OpDomainSource
 

Functions

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

Variables

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

Typedef Documentation

◆ OpDomainGradGrad

◆ OpDomainSource

◆ PostProcFaceEle

Function Documentation

◆ main()

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

Definition at line 326 of file standard_poisson.cpp.

326 {
327
328 // Initialisation of MoFEM/PETSc and MOAB data structures
329 const char param_file[] = "param_file.petsc";
330 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
331
332 // Add logging channel for example problem
333 auto core_log = logging::core::get();
334 core_log->add_sink(
336 LogManager::setLog("EXAMPLE");
337 MOFEM_LOG_TAG("EXAMPLE", "StandardPoisson");
338
339 // Error handling
340 try {
341 // Register MoFEM discrete manager in PETSc
342 DMType dm_name = "DMMOFEM";
343 CHKERR DMRegister_MoFEM(dm_name);
344
345 // Create MOAB instance
346 moab::Core mb_instance; // mesh database
347 moab::Interface &moab = mb_instance; // mesh database interface
348
349 // Create MoFEM instance
350 MoFEM::Core core(moab); // finite element database
351 MoFEM::Interface &m_field = core; // finite element interface
352
353 // Run the main analysis
354 StandardPoisson poisson_problem(m_field);
355 CHKERR poisson_problem.runProgram();
356 }
358
359 // Finish work: cleaning memory, getting statistics, etc.
361
362 return 0;
363}
#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 ( double x)
inline

Definition at line 7 of file standard_poisson.cpp.

7{ return x * x; }

Variable Documentation

◆ help

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

Definition at line 22 of file standard_poisson.cpp.

◆ SPACE_DIM

int SPACE_DIM = 2
constexpr

Definition at line 9 of file standard_poisson.cpp.