pub struct AmrtTree {
pub nodes: Vec<AmrtNode>,
pub max_level: usize,
pub domain: [f64; 6],
}Expand description
Oct-tree AMR data structure.
Manages a spatially recursive oct-tree where each node can be refined into
8 children. Nodes are stored in a flat Vec for cache-friendly traversal.
Fields§
§nodes: Vec<AmrtNode>Flat storage of all nodes.
max_level: usizeMaximum allowed refinement level.
domain: [f64; 6]Domain bounds \[x_min, y_min, z_min, x_max, y_max, z_max\].
Implementations§
Source§impl AmrtTree
impl AmrtTree
Sourcepub fn refine(&mut self, node_idx: usize) -> bool
pub fn refine(&mut self, node_idx: usize) -> bool
Refine the leaf at node_idx into 8 children.
Returns false if the node is already at max_level or is not a leaf.
Sourcepub fn coarsen(&mut self, parent_idx: usize) -> bool
pub fn coarsen(&mut self, parent_idx: usize) -> bool
Coarsen a set of 8 sibling leaves back to their parent.
Returns false if any sibling is not a leaf.
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Count active (non-deleted) leaf nodes.
Sourcepub fn max_active_level(&self) -> usize
pub fn max_active_level(&self) -> usize
Depth of the tree (maximum level among all active leaves).
Sourcepub fn cell_size_at(&self, level: usize) -> [f64; 3]
pub fn cell_size_at(&self, level: usize) -> [f64; 3]
Physical cell size at a given refinement level.
Sourcepub fn node_centre(&self, node_idx: usize) -> [f64; 3]
pub fn node_centre(&self, node_idx: usize) -> [f64; 3]
Physical centre of the node at node_idx.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AmrtTree
impl RefUnwindSafe for AmrtTree
impl Send for AmrtTree
impl Sync for AmrtTree
impl Unpin for AmrtTree
impl UnsafeUnpin for AmrtTree
impl UnwindSafe for AmrtTree
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<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.