Feel++  0.91.4
List of all members
Feel::Environment Class Reference

Initialize, finalize, and query the Feel++ environment. More...

#include <environment.hpp>

Inheritance diagram for Feel::Environment:

Public Member Functions

Constructors, destructor
 Environment ()
 
 Environment (int &argc, char **&argv)
 
 ~Environment ()
 

Static Public Member Functions

Accessors
static bool initialized ()
 
static bool finalized ()
 
Methods
static std::string rootRepository ()
 
static std::string localGeoRepository ()
 
static boost::tuple
< std::string, bool > 
systemGeoRepository ()
 
static std::string localConfigRepository ()
 
static boost::tuple
< std::string, bool > 
systemConfigRepository ()
 
static void changeRepository (boost::format fmt, std::string const &="logfile")
 change the directory where the results are stored
 
static po::variables_map vm (po::options_description const &desc)
 get variables_map from options_description desc
 
static void setLogs (std::string const &prefix)
 

Detailed Description

Initialize, finalize, and query the Feel++ environment.

The Environment class is used to initialize, finalize, and query the Feel++ environment. It will typically be used in the main() function of a program, which will create a single instance of Environment initialized with the arguments passed to the program:

int main(int argc, char* argv[])
{
Feel::Environment env(argc, argv);
}

The instance of Environment will initialize Feel++ (by calling MPI, PETSc, SLEPc and MAdLib initialization routines) in its constructor and finalize in its destructor.

Author
Christophe Prud'homme
See Also
Application

Constructor & Destructor Documentation

Feel::Environment::Environment ( )

Initialize the Feel environment.

If the Feel environment has not already been initialized, initializes Feel

Feel::Environment::Environment ( int &  argc,
char **&  argv 
)

Initialize the Feel environment.

If the Feel environment has not already been initialized, initializes Feel

Parameters
argcThe number of arguments provided in argv, as passed into the program's main function.
argvThe array of argument strings passed to the program via main.
Feel::Environment::~Environment ( )

Shuts down the Feel environment.

If this Environment object was used to initialize the Feel environment, and the Feel environment has not already been shut down (finalized), this destructor will shut down the Feel environment.

Member Function Documentation

bool Feel::Environment::finalized ( )
static

Determine if the MPI environment has already been finalized.

The routine is equivalent to a call to MPI_Finalized.

Returns
true if the MPI environment has been finalized.
bool Feel::Environment::initialized ( )
static

Determine if the MPI environment has already been initialized.

This routine is equivalent to a call to MPI_Initialized.

Returns
true if the MPI environment has been initialized.
std::string Feel::Environment::localConfigRepository ( )
static
Returns
the local config files repository (default: $HOME/feel/config)

References rootRepository().

Referenced by Feel::Application::doOptions().

std::string Feel::Environment::localGeoRepository ( )
static
Returns
the local geo files repository (default: $HOME/feel/geo)

References rootRepository().

Referenced by Feel::BOOST_PARAMETER_FUNCTION().

std::string Feel::Environment::rootRepository ( )
static
Returns
the root repository (default: $HOME/feel)

Referenced by changeRepository(), localConfigRepository(), localGeoRepository(), and Feel::Application::rootRepository().

void Feel::Environment::setLogs ( std::string const &  prefix)
static

set log files

Parameters
prefixprefix for log filenames

Referenced by changeRepository().

boost::tuple< std::string, bool > Feel::Environment::systemConfigRepository ( )
static
Returns
a tuple : the system config files repository (default: /usr/share/feel/config or /usr/local/share/feel/config) and true or false whether the directory exists or not

Referenced by Feel::Application::doOptions().

boost::tuple< std::string, bool > Feel::Environment::systemGeoRepository ( )
static
Returns
a tuple : the system geo files repository (default: /usr/share/feel/geo or /usr/local/share/feel/geo) and true or false whether the directory exists or not

Referenced by Feel::BOOST_PARAMETER_FUNCTION().