Class which implements functionality to generate VTK output from particles.
More...
#include <VTKWriter.h>
|
| | VTKWriter () |
| | Creates a new uninitialized VTKWriter.
|
| |
| | VTKWriter (const std::string &basename) |
| | Creates a new VTKWriter with the given basename for future file outputs.
|
| |
| | VTKWriter (const std::string &basename, const std::string &dirname) |
| | Creates a new VTKWriter with the given basename for future file outputs in the specified directory.
|
| |
| virtual | ~VTKWriter () |
| | Destroys the current VTKWriter object.
|
| |
| void | writeParticles (const ParticleContainer &particles, int iteration, int total) override |
| | Writes the type, mass, position, velocity and force of a ParticleContainer to a VTK file. Terminates program execution on error.
|
| |
| | FileWriter () |
| | Creates a new FileWriter with no file initialized.
|
| |
| | FileWriter (const std::string &filename) |
| | Creates a new FileWriter and opens the file with the given name.
|
| |
| virtual | ~FileWriter () |
| | Closes the opened file and destroys the FileWriter object.
|
| |
| void | openFile (const std::string &filename) |
| | Opens / creates the file with the given name.
|
| |
| void | closeFile () |
| | Closes the opened file if it exists, otherwise does nothing.
|
| |
| void | writeFile (const std::string &content, const std::string &filename="", int iteration=-1, int total=-1) |
| | Overwrites the contents of the file opened in m_file with a given string. On error, the program will terminate.
|
| |
|
| void | initializeOutput (int numParticles) |
| | Initializes m_vtkFile with necessary metadata for writing purposes. Terminates program execution on error.
|
| |
| void | writeFile (int iteration, int total) |
| | Writes the contents of m_vtkFile into a given VTK file. Terminates program execution on error.
|
| |
| void | plotParticle (const Particle &p) |
| | Plots a single particle to m_vtkFile. Terminates program execution on error.
|
| |
|
| VTKFile_t * | m_vtkFile |
| | The VTK file instance containing particle data.
|
| |
| std::string | m_basename = "MD_vtk" |
| | The base name of the generated files.
|
| |
| std::string | m_dirname = "vtk" |
| | The name of the directory in which to store the generated files.
|
| |
|
| static void | initializeFolder (const std::string &dirname) |
| | (Re)initializes the output directory.
|
| |
| std::ofstream | m_file |
| | Output stream containing the file to write contents to.
|
| |
Class which implements functionality to generate VTK output from particles.
◆ VTKWriter() [1/3]
◆ VTKWriter() [2/3]
| VTKWriter::VTKWriter |
( |
const std::string & |
basename | ) |
|
|
explicit |
Creates a new VTKWriter with the given basename for future file outputs.
- Parameters
-
| basename | The base name of the generated files. |
◆ VTKWriter() [3/3]
| VTKWriter::VTKWriter |
( |
const std::string & |
basename, |
|
|
const std::string & |
dirname |
|
) |
| |
Creates a new VTKWriter with the given basename for future file outputs in the specified directory.
- Parameters
-
| basename | The base name of the generated files. |
| dirname | The directory name of the generated files. |
◆ ~VTKWriter()
| virtual VTKWriter::~VTKWriter |
( |
| ) |
|
|
virtual |
◆ initializeOutput()
| void VTKWriter::initializeOutput |
( |
int |
numParticles | ) |
|
|
private |
Initializes m_vtkFile with necessary metadata for writing purposes. Terminates program execution on error.
- Parameters
-
| numParticles | The total number of particles. |
◆ plotParticle()
| void VTKWriter::plotParticle |
( |
const Particle & |
p | ) |
|
|
private |
Plots a single particle to m_vtkFile. Terminates program execution on error.
- Parameters
-
| p | The particle to be plotted. |
◆ writeFile()
| void VTKWriter::writeFile |
( |
int |
iteration, |
|
|
int |
total |
|
) |
| |
|
private |
Writes the contents of m_vtkFile into a given VTK file. Terminates program execution on error.
- Parameters
-
| iteration | The current iteration of the simulation. |
| total | The total number of iterations, used to display the current percentage. |
◆ writeParticles()
| void VTKWriter::writeParticles |
( |
const ParticleContainer & |
particles, |
|
|
int |
iteration, |
|
|
int |
total |
|
) |
| |
|
overridevirtual |
Writes the type, mass, position, velocity and force of a ParticleContainer to a VTK file. Terminates program execution on error.
- Parameters
-
| particles | The ParticleContainer. |
| iteration | The number of the current iteration, used to generate a unique filename. |
| total | The total number of iterations, used to display the current percentage. |
Implements FileWriter.
◆ m_basename
| std::string VTKWriter::m_basename = "MD_vtk" |
|
private |
The base name of the generated files.
◆ m_dirname
| std::string VTKWriter::m_dirname = "vtk" |
|
private |
The name of the directory in which to store the generated files.
◆ m_vtkFile
The VTK file instance containing particle data.
The documentation for this class was generated from the following file: