pub struct Rcb {
pub iter_count: usize,
pub tolerance: f64,
pub fast: bool,
}Expand description
§Recursive Coordinate Bisection algorithm
Partitions a mesh based on the nodes coordinates and coresponding weights.
This is the most simple and straightforward geometric algorithm. It operates as follows for a N-dimensional set of points:
At each iteration, select a vector n of the canonical basis
(e_0, ..., e_{n-1}). Then, split the set of points with an hyperplane
orthogonal to n, such that the two parts of the splits are evenly
weighted. Finally, recurse by reapplying the algorithm to the two parts with
an other normal vector selection.
§Example
use coupe::Partition as _;
use coupe::Point2D;
let points = [
Point2D::new(1., 1.),
Point2D::new(-1., 1.),
Point2D::new(1., -1.),
Point2D::new(-1., -1.),
];
let weights = [1; 4];
let mut partition = [0; 4];
// Generate a partition of 4 parts (2 splits).
coupe::Rcb { iter_count: 2, ..Default::default() }
.partition(&mut partition, (points, weights))
.unwrap();
// All points are in different parts.
for i in 0..4 {
for j in 0..4 {
if j == i {
continue
}
assert_ne!(partition[i], partition[j])
}
}§Reference
Berger, M. J. and Bokhari, S. H., 1987. A partitioning strategy for nonuniform problems on multiprocessors. IEEE Transactions on Computers, C-36(5):570–580. doi:10.1109/TC.1987.1676942.
Fields§
§iter_count: usizeThe number of iterations of the algorithm. This will yield a partition
of at most 2^num_iter parts.
If this equals zero, RCB will not do anything.
tolerance: f64Tolerance on the normalized imbalance, for each split. Please note that the overall imbalance might end up above this threshold.
Negative values are interpreted as zeroes.
fast: boolUse a faster, experimental implementation of the algorithm.
Trait Implementations§
Source§impl<const D: usize, P, W> Partition<(P, W)> for Rcbwhere
P: IntoParallelIterator<Item = PointND<D>>,
P::Iter: IndexedParallelIterator,
W: IntoParallelIterator,
W::Item: RcbWeight,
W::Iter: IndexedParallelIterator,
impl<const D: usize, P, W> Partition<(P, W)> for Rcbwhere
P: IntoParallelIterator<Item = PointND<D>>,
P::Iter: IndexedParallelIterator,
W: IntoParallelIterator,
W::Item: RcbWeight,
W::Iter: IndexedParallelIterator,
Auto Trait Implementations§
impl Freeze for Rcb
impl RefUnwindSafe for Rcb
impl Send for Rcb
impl Sync for Rcb
impl Unpin for Rcb
impl UnwindSafe for Rcb
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§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.