Output#

Overview#

The Polyhedral Gravity Model in general prints the output for all given computation points to a .csv file in order to keep the terminal clean. In order to achieve this the CSVWriter is used.

This module also contains the PolyhedralGravityLogger which serves as a Wrapper class for accessing spdlog’s Logger.

Implementations#

class CSVWriter#

By using spdlog, this class provides methods to print the result the polyhedral gravity model into an CSV file.

Note

The used Logger level is “info”, so this should be activated at least if output is wished!

Public Functions

inline CSVWriter()#

Creates a new CSVWriter. Results are written to “polyhedralGravityModel.csv”.

inline explicit CSVWriter(const std::string &filename)#

Creates a new CSVWriter. Results are written to file with filename as name.

Parameters:

filename – a string

inline ~CSVWriter()#

De-Registers the logger of the CSVWriter, to ensure that a similar CSVWriter can be constructed once again.

void printResult(const std::vector<std::array<double, 3>> &computationPoints, const std::vector<GravityModelResult> &gravityResults) const#

Prints the result to the specified file

Parameters:
  • computationPoints – vector of computation points

  • gravityResults – vector of gravity results

class PolyhedralGravityLogger#

Wrapper Class for a spdlog logger. It is used to configure the static DEFAULT_LOGGER of the polyhedral gravity model within the constructor.

Public Functions

inline PolyhedralGravityLogger()#

Constructs a new PolyhedralGravityLogger. Further, it registers the new logger in spdlog’s registry with the name POLYHEDRAL_GRAVITY_LOGGER.

inline std::shared_ptr<spdlog::logger> getLogger() const#

Returns the underlying pointer to spdlog’s logger object.

Returns:

a shared pointer to a spdlog’s logger object

Public Static Attributes

static const PolyhedralGravityLogger DEFAULT_LOGGER = {}#

The default logger which is used in the whole implementation for every logging.