Skip to main content

Bundle

Struct Bundle 

Source
pub struct Bundle<V, S: Storage<V> = VecStorage<V>, D = CopyDelta> {
    pub stack: InMemoryStack<PointId, PointId, Polarity>,
    pub section: Section<V, S>,
    pub delta: D,
    /* private fields */
}
Expand description

Bundle<V, S, D> packages a mesh‐to‐DOF stack, a data section, and a ValueDelta-type.

§Fields

  • stack: vertical arrows from base mesh points → cap (DOF) points, carrying a Polarity payload if needed.
  • section: contiguous storage of data V for each point in the atlas.
  • delta: rules for extracting (restrict) and merging (fuse) values.

Fields§

§stack: InMemoryStack<PointId, PointId, Polarity>

Vertical connectivity: base points → cap (DOF) points.

§section: Section<V, S>

Field data storage, indexed by PointId.

§delta: D

Delta strategy for refine/assemble operations.

Implementations§

Source§

impl<V, S: Storage<V>, D> Bundle<V, S, D>
where V: Clone + Default, D: ValueDelta<V, Part = V>,

Source

pub fn refine( &mut self, bases: impl IntoIterator<Item = PointId>, ) -> Result<(), MeshSieveError>

Refine: push data down the stack (base → cap) using per-arrow orientation.

For each base point in the sieve closure of bases, applies the orientation delta from the base slice to each cap slice. Disjoint source and destination slices are copied without allocation; overlapping slices are temporarily buffered for safety.

§Complexity

O(Σ deg(base) · k), where deg(base) is the number of cap points per base and k is the per-point slice length. One pass; no intermediate allocations.

§Determinism

Deterministic per cap point slice, independent of traversal order, provided the vertical mapping base -> {caps} has no duplicates. Polarity handling is local to each write.

§Errors

Propagates errors from Section::try_apply_delta_between_points.

Source

pub fn apply_constraints<C>( &mut self, constraints: &C, ) -> Result<(), MeshSieveError>
where V: Clone, C: ConstraintSet<V>,

Apply constraints to the underlying section.

Source

pub fn refine_with_constraints<C>( &mut self, bases: impl IntoIterator<Item = PointId>, constraints: &C, ) -> Result<(), MeshSieveError>
where V: Clone, C: ConstraintSet<V>,

Refine with constraints applied after the refinement step.

Source

pub fn assemble_with<R: SliceReducer<V>>( &mut self, bases: impl IntoIterator<Item = PointId>, reducer: &R, ) -> Result<(), MeshSieveError>

Assemble: pull data up the stack (cap → base) using element-wise averaging.

For each base point, gathers slices from all cap points and replaces the base slice with the element-wise average. Cap slices must match the base slice length.

§Complexity

O(Σ deg(base) · k); one pass.

§Determinism

Deterministic; each cap contributes at most once.

§Errors

Returns an error if any cap slice length differs from the base slice, in which case the [MeshSieveError::SliceLengthMismatch] reports the offending cap PointId. Also propagates reducer-specific errors such as primitive conversion failures.

§Behavior

Validates slice lengths using the base slice as ground truth, collects all cap slices once, and reduces them element-wise into a fresh accumulator before writing the result back to the base slice.

Source

pub fn assemble_with_constraints<R, C>( &mut self, bases: impl IntoIterator<Item = PointId>, reducer: &R, constraints: &C, ) -> Result<(), MeshSieveError>
where V: Clone, R: SliceReducer<V>, C: ConstraintSet<V>,

Assemble using the provided reducer, then apply constraints.

Source

pub fn assemble( &mut self, bases: impl IntoIterator<Item = PointId>, ) -> Result<(), MeshSieveError>
where V: Clone + Default + FromPrimitive + AddAssign + Div<Output = V>,

Backward-compatible assemble: element-wise average of cap slices.

§Migration

Prefer Bundle::assemble_with for explicit reduction control.

Source

pub fn assemble_with_constraints_default<C>( &mut self, bases: impl IntoIterator<Item = PointId>, constraints: &C, ) -> Result<(), MeshSieveError>
where V: Clone + Default + FromPrimitive + AddAssign + Div<Output = V>, C: ConstraintSet<V>,

Backward-compatible assemble with constraints using element-wise averaging.

Source

pub fn dofs<'a>( &'a self, p: PointId, ) -> impl Iterator<Item = Result<(PointId, &'a [V]), MeshSieveError>> + 'a

Iterate over (cap_point, &[V]) pairs for all DOFs attached to base p.

§Errors

Returns an error for any cap point missing in the underlying Section.

Auto Trait Implementations§

§

impl<V, S = VecStorage<V>, D = CopyDelta> !Freeze for Bundle<V, S, D>

§

impl<V, S, D> RefUnwindSafe for Bundle<V, S, D>

§

impl<V, S, D> Send for Bundle<V, S, D>
where D: Send, S: Send, V: Send,

§

impl<V, S, D> Sync for Bundle<V, S, D>
where D: Sync, S: Sync, V: Sync,

§

impl<V, S, D> Unpin for Bundle<V, S, D>
where D: Unpin, S: Unpin, V: Unpin,

§

impl<V, S, D> UnsafeUnpin for Bundle<V, S, D>
where D: UnsafeUnpin, S: UnsafeUnpin,

§

impl<V, S, D> UnwindSafe for Bundle<V, S, D>
where D: UnwindSafe, S: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> AccumulatePathExt for T

Source§

fn accumulate_path<O, I>(path: I) -> O
where O: Orientation, I: IntoIterator<Item = O>,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.