18std::pair<double, Particles>
Csv::load(
const fs::path& path,
double defaultDensity) {
19 io::CSVReader<9> in(path.string());
20 double startTime = std::stod(in.next_line());
21 double numParticles = std::stod(in.next_line());
23 in.read_header(io::ignore_missing_column,
"type",
"fluidType",
"x",
"y",
"z",
"vx",
"vy",
"vz",
"density");
26 double x, y, z, vx, vy, vz;
27 double density = -1.0;
29 while (in.read_row(type, fluidType, x, y, z, vx, vy, vz, density)) {
30 Eigen::Vector3d pos(x, y, z);
31 Eigen::Vector3d vel(vx, vy, vz);
33 density = defaultDensity;
38 return std::make_pair(startTime, particles);
Class for particle in MPS method.
Class for loading particles from a prof file.
std::pair< double, Particles > load(const fs::path &path, double defaultDensity) override
Load particles.
A collection of particles.
int size() const
Get the number of particles.
void add(const Particle &particle)
Add a particle to the collection.
ParticleType
Enum class for particle type.