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 spdlog logger

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#

Public Static Attributes

static const PolyhedralGravityLogger DEFAULT_LOGGER = {}#

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