Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77471793
csv_writer.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Aug 14, 16:39
Size
777 B
Mime Type
text/x-c
Expires
Fri, Aug 16, 16:39 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
19875683
Attached To
R7571 SP4E-TB-TL-FR
csv_writer.cc
View Options
#include "csv_writer.hh"
#include <cstdlib>
#include <fstream>
/* -------------------------------------------------------------------------- */
CsvWriter::CsvWriter(const std::string& filename) : filename(filename) {}
/* -------------------------------------------------------------------------- */
void CsvWriter::write(System& system) { this->compute(system); }
/* -------------------------------------------------------------------------- */
void CsvWriter::compute(System& system) {
std::ofstream os(this->filename);
UInt nParticles = system.getNbParticles();
// std::cout << nParticles << std::endl;
for (UInt i=0; i<nParticles; i++){
Particle &p = system.getParticle(i);
p.printself(os);
os << std::endl;
}
os.close();
}
Event Timeline
Log In to Comment