Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Public Member Functions | Private Attributes | List of all members
CSVWriter Class Reference

#include <CSVWriter.h>

Collaboration diagram for CSVWriter:
Collaboration graph

Public Member Functions

 CSVWriter (int numberOfBins, std::string filename)
 Construct new CSVWriter. A csv file is opened ones and closed, when this class is destructed. More...
 
 ~CSVWriter ()
 When this object is destructed, the csv file is closed. More...
 
int writeProfile (std::vector< double > &velocities, double time)
 Write one data set of a velocity profile to a csv file. More...
 

Private Attributes

std::ofstream file
 
int numberOfBins
 

Detailed Description

Writing profiles to a csv file.

Constructor & Destructor Documentation

◆ CSVWriter()

CSVWriter::CSVWriter ( int  numberOfBins,
std::string  filename 
)

Construct new CSVWriter. A csv file is opened ones and closed, when this class is destructed.

Parameters
numberOfBinsNumber of bins to use.

◆ ~CSVWriter()

CSVWriter::~CSVWriter ( )

When this object is destructed, the csv file is closed.

Member Function Documentation

◆ writeProfile()

int CSVWriter::writeProfile ( std::vector< double > &  velocities,
double  time 
)

Write one data set of a velocity profile to a csv file.

Parameters
velocitiesAverage velocities along y-axis of particles in each bin
timeCurrent time in the simulation.
Returns
0 on success, on error some value unequal 0.
Here is the caller graph for this function:

Member Data Documentation

◆ file

std::ofstream CSVWriter::file
private

◆ numberOfBins

int CSVWriter::numberOfBins
private

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