Static Public Member Functions | Static Private Member Functions
Sundance::SundanceGlobal Class Reference

Class Sundance provides several static methods for managing the environment of a simulation. More...

List of all members.

Static Public Member Functions

static void setOption (const std::string &optionName, int &value, const std::string &helpMsg)
static void setOption (const std::string &optionName, std::string &value, const std::string &helpMsg)
static void setOption (const std::string &optionName, double &value, const std::string &helpMsg)
static void setOption (const std::string &optionTrueName, const std::string &optionFalseName, bool &value, const std::string &helpMsg)
static int init (int *argc, char ***argv)
 Do initialization steps such as starting MPI (if necessary), parsing the Unix command line, and reading runtime options from the configuration file.
static int finalize ()
 Do finalization steps such as calling MPI_finalize() (if necessary), and collecting and printing timing information.
static void handleException (std::exception &e)
static Teuchos::FancyOStream & os ()
static bool passFailTest (bool pass)
static bool passFailTest (double error, double tol)
static bool passFailTest (const std::string &statusMsg, bool status, double error, double tol)
static bool & showStartupMessage ()
 Set to true if a message should be written by each processor at startup.
static bool & skipTimingOutput ()
 Decide whether to skip timing outputs to work around a trilinos 6.0.x bug.
static int & testStatus ()
static CommandLineProcessor & clp ()

Static Private Member Functions

static bool checkTest (double error, double tol)
static RCP< GlobalMPISession > globalMPISession (int *argc, char ***argv)

Detailed Description

Class Sundance provides several static methods for managing the environment of a simulation.

Every simulation code should begin with a call to Sundance::init() and end with a call to Sundance::finalize().

Definition at line 207 of file Sundance.hpp.


Member Function Documentation

bool SundanceGlobal::checkTest ( double  error,
double  tol 
) [static, private]

Definition at line 310 of file Sundance.cpp.

Referenced by passFailTest().

CommandLineProcessor & clp ( ) [inline, static]

Definition at line 283 of file Sundance.hpp.

Referenced by Sundance::clp(), init(), and setOption().

int finalize ( ) [static]

Do finalization steps such as calling MPI_finalize() (if necessary), and collecting and printing timing information.

Definition at line 277 of file Sundance.cpp.

References handleException(), skipTimingOutput(), Sundance::QuadratureEvalMediator::totalFlops(), Sundance::CellJacobianBatch::totalFlops(), Sundance::RefIntegral::totalFlops(), Sundance::QuadratureIntegralBase::totalFlops(), Sundance::EvalVector::totalFlops(), and totalTimer().

Referenced by Sundance::finalize().

static RCP<GlobalMPISession> Sundance::SundanceGlobal::globalMPISession ( int *  argc,
char ***  argv 
) [inline, static, private]

Definition at line 289 of file Sundance.hpp.

Referenced by init().

void handleException ( std::exception &  e) [static]

Definition at line 268 of file Sundance.cpp.

References testStatus().

Referenced by finalize(), Sundance::handleException(), and init().

int init ( int *  argc,
char ***  argv 
) [static]

Do initialization steps such as starting MPI (if necessary), parsing the Unix command line, and reading runtime options from the configuration file.

MPI is initialized through a call to Teuchos::GlobalMPISession, which in turn checks whether MPI needs initialization and calls MPI_Init() if necessary. If some other library you're using has its own MPI initialization system, it is thus perfectly safe to call Sundance::init() as well.

Definition at line 139 of file Sundance.cpp.

References clp(), Sundance::VersionString::date(), globalMPISession(), handleException(), Sundance::VersionString::number(), skipTimingOutput(), Sundance::toString(), totalTimer(), and Sundance::Assembler::workSetSize().

Referenced by Sundance::init().

static Teuchos::FancyOStream& Sundance::SundanceGlobal::os ( ) [static]
bool passFailTest ( const std::string &  statusMsg,
bool  status,
double  error,
double  tol 
) [static]

Definition at line 344 of file Sundance.cpp.

References checkTest(), and testStatus().

bool passFailTest ( bool  pass) [static]

Definition at line 373 of file Sundance.cpp.

References testStatus().

Referenced by Sundance::passFailTest().

bool passFailTest ( double  error,
double  tol 
) [static]

Definition at line 319 of file Sundance.cpp.

References checkTest(), and testStatus().

void SundanceGlobal::setOption ( const std::string &  optionName,
int &  value,
const std::string &  helpMsg 
) [static]

Definition at line 391 of file Sundance.cpp.

References clp(), and Sundance::value.

Referenced by Sundance::setOption().

void SundanceGlobal::setOption ( const std::string &  optionTrueName,
const std::string &  optionFalseName,
bool &  value,
const std::string &  helpMsg 
) [static]

Definition at line 412 of file Sundance.cpp.

References clp(), and Sundance::value.

void SundanceGlobal::setOption ( const std::string &  optionName,
std::string &  value,
const std::string &  helpMsg 
) [static]

Definition at line 405 of file Sundance.cpp.

References clp(), and Sundance::value.

void SundanceGlobal::setOption ( const std::string &  optionName,
double &  value,
const std::string &  helpMsg 
) [static]

Definition at line 398 of file Sundance.cpp.

References clp(), and Sundance::value.

bool & SundanceGlobal::showStartupMessage ( ) [static]

Set to true if a message should be written by each processor at startup.

Definition at line 256 of file Sundance.cpp.

static bool& Sundance::SundanceGlobal::skipTimingOutput ( ) [inline, static]

Decide whether to skip timing outputs to work around a trilinos 6.0.x bug.

Definition at line 275 of file Sundance.hpp.

Referenced by finalize(), and init().

int & testStatus ( ) [inline, static]

Definition at line 279 of file Sundance.hpp.

Referenced by handleException(), passFailTest(), and Sundance::testStatus().

Site Contact