walberla::Environment Class Reference

Detailed Description

RAII Object to initialize waLBerla using command line parameters.

#include <Environment.h>

Public Member Functions

 Environment (int &argc, char **&argv, bool mpiAbortOnException=true)
 Constructor. More...
 ~Environment ()
shared_ptr< Configconfig ()
 Returns configuration object, or null if no configuration object exists. More...

Protected Attributes

shared_ptr< Configconfig_
mpi::Environment mpiEnv_

Constructor & Destructor Documentation

◆ Environment()

walberla::Environment::Environment ( int &  argc,
char **&  argv,
bool  mpiAbortOnException = true 


argc,argvIf command line parameters are present they have to contain at least the path to the configuration file and optionally pairs of param-value: "-myParameter myValue" These values are then substituted in configuration files at positions marked with It is also possible to pass no command line options (see description below )

If command line arguments are present the constructor initializes static objects and singleton classes using information of configuration file

  • MPIManager ( via mpi::Environment )
  • reads configuration file
  • configures Logging
  • configures GlobalState

If no command line arguments are present only MPI subsystem is initialized and

  • logging is configured to default state
  • the global state is configured to a default state (the global state still can be configured by manually calling GlobalState::instance()->configure())

◆ ~Environment()

walberla::Environment::~Environment ( )

Member Function Documentation

◆ config()

shared_ptr<Config> walberla::Environment::config ( )

Returns configuration object, or null if no configuration object exists.

handle to configuration object, if a path to configuration file was in the command line arguments as passed to constructor, otherwise a null pointer

Member Data Documentation

◆ config_

shared_ptr<Config> walberla::Environment::config_

◆ mpiEnv_

mpi::Environment walberla::Environment::mpiEnv_

The documentation for this class was generated from the following files: