GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
Logging Class Reference

Manages logging of simulation data to files. More...

#include <logging.h>

Public Member Functions

 Logging (const std::string &filename_position, const std::string &filename_data)
 Constructs a Logging object and opens the file for writing.
 
 ~Logging ()
 Destructor to close the file when the Logging object is destroyed.
 
void logPositions_xyz (const std::vector< Particle > &particles, const SimulationBox &box, double r2cut)
 Logs the positions of all particles to the file.
 
void logPositions_dump (const std::vector< Particle > &particles)
 Logs the positions of all particles to the file.
 
void logSimulationData (const Simulation &sim, int timestep)
 Logs the simularion data like energy pressure, number of particles of the system to the data file.
 
void close ()
 Closes the log file.
 

Detailed Description

Manages logging of simulation data to files.

Constructor & Destructor Documentation

◆ Logging()

Logging::Logging ( const std::string & filename_position,
const std::string & filename_data )

Constructs a Logging object and opens the file for writing.

Parameters
filenameThe name of the file where data will be logged.

◆ ~Logging()

Logging::~Logging ( )

Destructor to close the file when the Logging object is destroyed.

Member Function Documentation

◆ close()

void Logging::close ( )

Closes the log file.

◆ logPositions_dump()

void Logging::logPositions_dump ( const std::vector< Particle > & particles)

Logs the positions of all particles to the file.

Parameters
particlesThe vector of particles whose positions will be logged in the dump format.

◆ logPositions_xyz()

void Logging::logPositions_xyz ( const std::vector< Particle > & particles,
const SimulationBox & box,
double r2cut )

Logs the positions of all particles to the file.

Parameters
particlesThe vector of particles whose positions will be logged in the xyz format.

◆ logSimulationData()

void Logging::logSimulationData ( const Simulation & sim,
int timestep )

Logs the simularion data like energy pressure, number of particles of the system to the data file.

Parameters
energyThe total energy of the system.
timestepThe current timestep in the simulation.

The documentation for this class was generated from the following files: