pub struct Parameters<R: Scalar> {
pub particle_radius: R,
pub rest_density: R,
pub compact_support_radius: R,
pub cube_size: R,
pub iso_surface_threshold: R,
pub particle_aabb: Option<Aabb3d<R>>,
pub enable_multi_threading: bool,
pub enable_simd: bool,
pub spatial_decomposition: SpatialDecomposition,
pub global_neighborhood_list: bool,
}Expand description
Parameters for the surface reconstruction
Fields§
§particle_radius: RRadius per particle (used to calculate the particle volume)
rest_density: RRest density of the fluid
compact_support_radius: RCompact support radius of the kernel, i.e. distance from the particle where kernel reaches zero (in distance units, not relative to particle radius)
cube_size: REdge length of the marching cubes implicit background grid (in distance units, not relative to particle radius)
iso_surface_threshold: RRelative rest density threshold value to distinguish between the inside (above threshold) and outside (below threshold) of the fluid
particle_aabb: Option<Aabb3d<R>>Bounding box of particles to reconstruct
All particles outside of this domain will be filtered out before the reconstruction. The surface reconstruction always results in a closed mesh around the particles. The final mesh can extend beyond this AABB due to the smoothing of the kernel. If not provided, the smallest AABB enclosing all particles is computed instead.
enable_multi_threading: boolWhether to allow multi threading within the surface reconstruction procedure
enable_simd: boolWhether to enable SIMD vectorization for some computations if supported by the target architecture
Currently only supported on x86/x86_64 (AVX2 + FMA) and aarch64 (NEON) for single precision (f32) reconstructions.
spatial_decomposition: SpatialDecompositionParameters for the spatial decomposition of the surface reconstruction If not provided, no spatial decomposition is performed and a global approach is used instead.
global_neighborhood_list: boolWhether to return the global particle neighborhood list from the reconstruction. Depending on the settings of the reconstruction, neighborhood lists are only computed locally in subdomains. Enabling this flag joins this data over all particles which can add a small overhead.
Implementations§
Source§impl<R: Real> Parameters<R>
impl<R: Real> Parameters<R>
Sourcepub fn new(particle_radius: R, compact_support_radius: R, cube_size: R) -> Self
pub fn new(particle_radius: R, compact_support_radius: R, cube_size: R) -> Self
Creates a new set of parameters with the specified (absolute) parameters and default values for the rest
The arguments are in absolute distance units, not relative to the particle radius. A default rest density of 1000.0 and iso surface threshold of 0.6 is used. Multi threading and spatial decomposition is enabled.
Sourcepub fn new_relative(
particle_radius: R,
relative_compact_support_radius: R,
relative_cube_size: R,
) -> Self
pub fn new_relative( particle_radius: R, relative_compact_support_radius: R, relative_cube_size: R, ) -> Self
Creates a new set of parameters with the specified parameters relative to the particle radius and default values for the rest
The arguments are relative to the particle radius, i.e. the actual values are computed as particle_radius * relative_*.
For the remaining parameters, see Parameters::new.
Sourcepub fn try_convert<T: Real>(&self) -> Option<Parameters<T>>
pub fn try_convert<T: Real>(&self) -> Option<Parameters<T>>
Trait Implementations§
Source§impl<R: Clone + Scalar> Clone for Parameters<R>
impl<R: Clone + Scalar> Clone for Parameters<R>
Source§fn clone(&self) -> Parameters<R>
fn clone(&self) -> Parameters<R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<R> Freeze for Parameters<R>where
R: Freeze,
impl<R> RefUnwindSafe for Parameters<R>where
R: RefUnwindSafe,
impl<R> Send for Parameters<R>where
R: Send,
impl<R> Sync for Parameters<R>where
R: Sync,
impl<R> Unpin for Parameters<R>where
R: Unpin,
impl<R> UnsafeUnpin for Parameters<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Parameters<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.