GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
logging.h
Go to the documentation of this file.
1#ifndef LOGGING_H
2#define LOGGING_H
3
4#include <fstream>
5#include <vector>
6#include "initial.h" // Include the Particle class definition
7// Forward declaration of the Simulation class
8class Simulation;
9
13class Logging {
14private:
15 std::ofstream outFile_position;
16 std::ofstream outFile_data;
17 std::string filename_position;
18 std::string filename_data;
19
20public:
25 Logging(const std::string &filename_position, const std::string &filename_data);
26
30 ~Logging();
31
36 void logPositions_xyz(const std::vector<Particle> &particles, const SimulationBox &box, double r2cut);
37
42 void logPositions_dump(const std::vector<Particle> &particles);
43
49 void logSimulationData(const Simulation &sim, int timestep);
50
54 void close();
55};
56
57#endif // LOGGING_H
Manages logging of simulation data to files.
Definition logging.h:13
void logSimulationData(const Simulation &sim, int timestep)
Logs the simularion data like energy pressure, number of particles of the system to the data file.
Definition logging.cpp:58
void logPositions_dump(const std::vector< Particle > &particles)
Logs the positions of all particles to the file.
Definition logging.cpp:47
void logPositions_xyz(const std::vector< Particle > &particles, const SimulationBox &box, double r2cut)
Logs the positions of all particles to the file.
Definition logging.cpp:28
Logging(const std::string &filename_position, const std::string &filename_data)
Constructs a Logging object and opens the file for writing.
Definition logging.cpp:6
void close()
Closes the log file.
Definition logging.cpp:65
~Logging()
Destructor to close the file when the Logging object is destroyed.
Definition logging.cpp:19
Manages the 2D simulation box, including periodic boundary conditions.
Definition initial.h:31
Manages the entire simulation process, including initialization, running the simulation,...
Definition simulation.h:35