Molecular Dynamics Simulation
1.0
|
Wrapper class to abstract the writing of output files. More...
#include <FileOutputHandler.h>
Public Member Functions | |
FileOutputHandler (const OutputFormat output_format, const SimulationParams ¶ms) | |
Construct a new FileOutputHandler object. More... | |
std::optional< const std::filesystem::path > | writeFile (size_t iteration, const std::unique_ptr< ParticleContainer > &particle_container) const |
Writes the given ParticleContainers particle data to a file. More... | |
std::optional< const std::filesystem::path > | writeFile (size_t iteration, const std::vector< Particle > &particles) const |
Writes the given ParticleContainers particle data to a file. More... | |
Private Attributes | |
const SimulationParams & | params |
SimulationParams object which provides the output directory path. More... | |
std::unique_ptr< FileWriter > | file_writer |
Pointer to the FileWriter object to use. More... | |
Wrapper class to abstract the writing of output files.
Currently there are two supported output formats: VTU and XYZ. Additionally a 'NONE' format is available, which does not write any output.
Definition at line 16 of file FileOutputHandler.h.
|
explicit |
Construct a new FileOutputHandler object.
output_format | The output format to use |
params | SimulationParams object which provides the output directory path |
Definition at line 10 of file FileOutputHandler.cpp.
std::optional< const std::filesystem::path > FileOutputHandler::writeFile | ( | size_t | iteration, |
const std::unique_ptr< ParticleContainer > & | particle_container | ||
) | const |
Writes the given ParticleContainers particle data to a file.
iteration | The current iteration number of the simulation |
particle_container | The ParticleContainer to write to the file |
Definition at line 65 of file FileOutputHandler.cpp.
std::optional< const std::filesystem::path > FileOutputHandler::writeFile | ( | size_t | iteration, |
const std::vector< Particle > & | particles | ||
) | const |
Writes the given ParticleContainers particle data to a file.
iteration | The current iteration number of the simulation |
particles | A vector of particles to write to the file |
Definition at line 57 of file FileOutputHandler.cpp.
|
private |
Pointer to the FileWriter object to use.
Definition at line 26 of file FileOutputHandler.h.
|
private |
SimulationParams object which provides the output directory path.
Definition at line 21 of file FileOutputHandler.h.