App

class App : public godzilla::PrintInterface

Public Functions

App(const mpi::Communicator &comm, const std::string &name, int argc, const char *const *argv)

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, const std::string &name, const std::vector<std::string> &args)

Build an application.

Parameters:
  • comm – MPI communicator

  • name – Name of the application

  • args – Command line arguments (without the executable name as first argument)

App(const mpi::Communicator &comm, const Registry &registry, const std::string &name, int argc, const char *const *argv)

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

App(const mpi::Communicator &comm, const Registry &registry, const std::string &name, const std::vector<std::string> &args)

Build an application object.

Parameters:
  • comm – MPI communicator

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

  • name – Name of the application

  • args – Command line arguments (without the executable name as first argument)

Logger *get_logger() const

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

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

virtual cxxopts::ParseResult parse_command_line()

Parse command line arguments.

Returns:

Result of parsing the command line

virtual void process_command_line(const cxxopts::ParseResult &result)

Process command line.

Parameters:

result – Result from calling parse_command_line or cxxopt::parse

bool check_integrity()

Check integrity of the application.

Returns:

true if the check passed, false otherwise

virtual void run()

Run the application.

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_input_file_name() const

Get the input file name.

Returns:

The input 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

Public Static Functions

static Registry &get_registry()

Get the instance of registry.

Returns:

Instance of the Registry class