App

class App : public godzilla::PrintInterface

Public Functions

App(const mpi::Communicator &comm, const std::string &name)

Build an application object.

Parameters:
  • comm – MPI communicator

  • name – Name of the application

  • argc – Number of command line arguments

  • argv – Command line arguments

App(const mpi::Communicator &comm, Registry &registry, const std::string &name)

Build an application object.

Parameters:
  • comm – MPI communicator

  • registry – Registry with classes that will be used by the application

  • name – Name of the application

  • argc – Number of command line arguments

  • argv – Command line arguments

Logger *get_logger()

Get logger associated with the application.

Returns:

Logger

const std::string &get_name() const

Get Application name.

Returns:

Application name

virtual const std::string &get_version() const

Get application version.

Returns:

The application version as a string

Registry &get_registry()

Get the instance of registry.

Returns:

Instance of the Registry class

Factory &get_factory()

Get the factory for building objects.

Returns:

Factory that builds objects

Problem *get_problem() const

Get pointer to the Problem class in this application.

Returns:

Get problem this application is representing

template<typename T>
inline T *get_problem() const

Get pointer to the Problem-derived class in this application.

Returns:

The problem this application is solving

bool check_integrity()

Check integrity of the application.

Returns:

true if the check passed, false otherwise

virtual int run()

Run the application.

Returns:

Exit code

const unsigned int &get_verbosity_level() const

Get level of verbosity.

Returns:

The verbosity level

void set_verbosity_level(unsigned int level)

Set verbosity level.

Parameters:

level – Verbosity level

const std::string &get_restart_file_name() const

Get restart file name.

Returns:

The restart file name

void set_restart_file_name(const std::string &file_name)

Set restart file name.

@file_name The restart file name

const mpi::Communicator &get_comm() const

Get MPI communicator.

Returns:

MPI communicator

Parameters *get_parameters(const std::string &class_name)

Get parameters for a class.

Parameters:

class_name – Class name to get parameters for

Returns:

Parameters for class class_name

template<typename T>
T *build_object(const std::string &obj_name, Parameters &parameters)

Build object using the Factory.

This is convenience API for building object with having the _app parameter set to this application object.

Parameters:
  • obj_name – Name of the object

  • parameters – Input parameters

Returns:

The constructed object

void export_parameters_yaml() const

Export parameters into a YAML format.

void set_perf_log_file_name(const std::string &file_name)

Set file name where to wrote the perf log.

Parameters:

file_name – Perf log file name

void redirect_stdout(const std::string &file_name)

Redirect standard output into file.

Parameters:

file_name – File to redirect stdout to

void redirect_stderr(const std::string &file_name)

Redirect standard error into file.

Parameters:

file_name – File to redirect stderr to