MPS-Basic
Loading...
Searching...
No Matches
number_density.cpp
Go to the documentation of this file.
1#include "number_density.hpp"
2
4
5bool NumberDensity::isFreeSurface(const Particles& particles, const Particle& particle) {
6 return particle.numberDensity < thresholdRatio * n0;
7}
8
11
12NumberDensity::NumberDensity(double thresholdRatio, double n0) {
13 this->thresholdRatio = thresholdRatio;
14 this->n0 = n0;
15}
Class for particle in MPS method.
Definition particle.hpp:47
double numberDensity
number density of the particle
Definition particle.hpp:59
A collection of particles.
Definition particles.hpp:10
Detects free surface based on the number density.
NumberDensity(double thresholdRatio, double n0)
double thresholdRatio
threshold ratio for number density
double n0
reference value for number density
bool isFreeSurface(const Particles &particles, const Particle &particle) override
Whether the particle is on the free surface.