pub struct BarnesHutTree {
pub root: OctreeNode,
pub softening: f64,
}Expand description
Barnes-Hut tree for O(N log N) gravity.
Fields§
§root: OctreeNodeRoot node.
softening: f64Softening length.
Implementations§
Source§impl BarnesHutTree
impl BarnesHutTree
Sourcepub fn build(particles: &[GravityParticle], softening: f64) -> Self
pub fn build(particles: &[GravityParticle], softening: f64) -> Self
Build tree from particles.
Sourcepub fn compute_forces(&self, particles: &mut [GravityParticle], theta: f64)
pub fn compute_forces(&self, particles: &mut [GravityParticle], theta: f64)
Compute forces on all particles using tree.
Trait Implementations§
Source§impl Clone for BarnesHutTree
impl Clone for BarnesHutTree
Source§fn clone(&self) -> BarnesHutTree
fn clone(&self) -> BarnesHutTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BarnesHutTree
impl RefUnwindSafe for BarnesHutTree
impl Send for BarnesHutTree
impl Sync for BarnesHutTree
impl Unpin for BarnesHutTree
impl UnsafeUnpin for BarnesHutTree
impl UnwindSafe for BarnesHutTree
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.