13std::pair<double, Particles>
Prof::load(
const fs::path& path,
double defaultDensity) {
17 cerr <<
"cannot read prof file: " << fs::absolute(path) << endl;
22 double startTime = NAN;
26 for (
int i = 0; i < particleSize; i++) {
29 Eigen::Vector3d pos, vel;
32 ifs >> pos.x() >> pos.y() >> pos.z();
33 ifs >> vel.x() >> vel.y() >> vel.z();
36 particles.
add(
Particle(particles.
size(), type, pos, vel, defaultDensity));
39 return {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.