Struct splashsurf_lib::octree::Octree
source · pub struct Octree<I: Index, R: Real> { /* private fields */ }
Expand description
Data structure for octree based spatial subdivision of particles sets, for tree iteration/visitation use the root
OctreeNode
Implementations§
source§impl<I: Index, R: Real> Octree<I, R>
impl<I: Index, R: Real> Octree<I, R>
sourcepub fn new(grid: &UniformGrid<I, R>, n_particles: usize) -> Self
pub fn new(grid: &UniformGrid<I, R>, n_particles: usize) -> Self
Creates a new octree with a single leaf node containing all vertices
sourcepub fn new_subdivided(
grid: &UniformGrid<I, R>,
particle_positions: &[Vector3<R>],
subdivision_criterion: SubdivisionCriterion,
margin: R,
enable_multi_threading: bool,
enable_stitching: bool
) -> Self
pub fn new_subdivided( grid: &UniformGrid<I, R>, particle_positions: &[Vector3<R>], subdivision_criterion: SubdivisionCriterion, margin: R, enable_multi_threading: bool, enable_stitching: bool ) -> Self
Create a new octree and perform subdivision with the specified margin
The margin is used to assign ghost particles to octree nodes. Each octant resulting from the subdivision gets assigned all particles that are directly inside it plus all particles from its parent that are within the given margin around the octant.
sourcepub fn root(&self) -> &OctreeNode<I, R>
pub fn root(&self) -> &OctreeNode<I, R>
Returns a reference to the root node of the octree
sourcepub fn root_mut(&mut self) -> &mut OctreeNode<I, R>
pub fn root_mut(&mut self) -> &mut OctreeNode<I, R>
Returns a mutable reference to the root node of the octree
sourcepub fn subdivide_recursively_margin(
&mut self,
grid: &UniformGrid<I, R>,
particle_positions: &[Vector3<R>],
subdivision_criterion: SubdivisionCriterion,
margin: R,
enable_stitching: bool
)
pub fn subdivide_recursively_margin( &mut self, grid: &UniformGrid<I, R>, particle_positions: &[Vector3<R>], subdivision_criterion: SubdivisionCriterion, margin: R, enable_stitching: bool )
Subdivide the octree recursively using the given splitting criterion and a margin to add ghost particles
sourcepub fn par_subdivide_recursively_margin(
&mut self,
grid: &UniformGrid<I, R>,
particle_positions: &[Vector3<R>],
subdivision_criterion: SubdivisionCriterion,
margin: R,
enable_stitching: bool
)
pub fn par_subdivide_recursively_margin( &mut self, grid: &UniformGrid<I, R>, particle_positions: &[Vector3<R>], subdivision_criterion: SubdivisionCriterion, margin: R, enable_stitching: bool )
Subdivide the octree recursively and in parallel using the given splitting criterion and a margin to add ghost particles
sourcepub fn hexmesh(
&self,
grid: &UniformGrid<I, R>,
only_non_empty: bool
) -> MeshWithData<R, HexMesh3d<R>>
pub fn hexmesh( &self, grid: &UniformGrid<I, R>, only_non_empty: bool ) -> MeshWithData<R, HexMesh3d<R>>
Constructs a hex mesh visualizing the cells of the octree, may contain hanging and duplicate vertices as cells are not connected
Trait Implementations§
Auto Trait Implementations§
impl<I, R> RefUnwindSafe for Octree<I, R>where I: RefUnwindSafe, R: RefUnwindSafe,
impl<I, R> Send for Octree<I, R>
impl<I, R> Sync for Octree<I, R>
impl<I, R> Unpin for Octree<I, R>where I: Unpin, R: Unpin,
impl<I, R> UnwindSafe for Octree<I, R>where I: UnwindSafe, 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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.