MPS-Basic
Loading...
Searching...
No Matches
particles_exporter.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "common.hpp"
4#include "particles.hpp"
5
6#include <filesystem>
7#include <fstream>
8#include <vector>
9
20private:
27 bool isBigEndian() const;
28
36 std::string dataArrayBegin(
37 const std::string& type,
38 const std::string& name,
39 int numberOfComponents,
40 const std::string& format,
41 size_t offset = SIZE_MAX
42 ) const;
45 std::string dataArrayEnd() const;
46
51 void toVtuAscii(const std::filesystem::path& path, const double& time, const double& n0ForNumberDensity = 1.0);
52
57 void toVtuBinary(const std::filesystem::path& path, const double& time, const double& n0ForNumberDensity = 1.0);
58
59public:
61
64 void setParticles(const Particles& particles);
65
69 void toProf(const std::filesystem::path& path, const double& time);
70
75 void toVtu(
76 const std::filesystem::path& path,
77 const double& time,
78 const double& n0ForNumberDensity = 1.0,
79 const bool binary = false
80 );
81
85 void toCsv(const std::filesystem::path& path, const double& time);
86};
void toVtuAscii(const std::filesystem::path &path, const double &time, const double &n0ForNumberDensity=1.0)
Export the particles to a file in the VTK zlib format.
void setParticles(const Particles &particles)
Set the particles to export to a file. This method is required before exporting.
void toVtu(const std::filesystem::path &path, const double &time, const double &n0ForNumberDensity=1.0, const bool binary=false)
Export the particles to a file in the VTK zlib format.
void toVtuBinary(const std::filesystem::path &path, const double &time, const double &n0ForNumberDensity=1.0)
Export the particles to a file in the VTK zlib format.
void toProf(const std::filesystem::path &path, const double &time)
Export the particles to a file in the Prof format.
std::string dataArrayBegin(const std::string &type, const std::string &name, int numberOfComponents, const std::string &format, size_t offset=SIZE_MAX) const
write the header of DataArray for the VTK format
std::string dataArrayEnd() const
write the end of DataArray for the VTK format
bool isBigEndian() const
detect the endian of the system
void toCsv(const std::filesystem::path &path, const double &time)
Export the particles to a file in the CSV format.
A collection of particles.
Definition particles.hpp:10