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.
V: underlying data type stored at each DOF (e.g.,f64,i32, …).S: storage backend for the section (defaults toVecStorage).D: overlapValueDeltaimplementation guiding how values are reduced/merged across parts (defaults to CopyDelta). For per-slice permutation/orientation, seecrate::data::refine::delta::SliceDelta.
§Fields
stack: vertical arrows from base mesh points → cap (DOF) points, carrying aPolaritypayload if needed.section: contiguous storage of dataVfor 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: DDelta strategy for refine/assemble operations.
Implementations§
Source§impl<V, S: Storage<V>, D> Bundle<V, S, D>
impl<V, S: Storage<V>, D> Bundle<V, S, D>
Sourcepub fn refine(
&mut self,
bases: impl IntoIterator<Item = PointId>,
) -> Result<(), MeshSieveError>
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.
Sourcepub fn apply_constraints<C>(
&mut self,
constraints: &C,
) -> Result<(), MeshSieveError>where
V: Clone,
C: ConstraintSet<V>,
pub fn apply_constraints<C>(
&mut self,
constraints: &C,
) -> Result<(), MeshSieveError>where
V: Clone,
C: ConstraintSet<V>,
Apply constraints to the underlying section.
Sourcepub fn refine_with_constraints<C>(
&mut self,
bases: impl IntoIterator<Item = PointId>,
constraints: &C,
) -> Result<(), MeshSieveError>where
V: Clone,
C: ConstraintSet<V>,
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.
Sourcepub fn assemble_with<R: SliceReducer<V>>(
&mut self,
bases: impl IntoIterator<Item = PointId>,
reducer: &R,
) -> Result<(), MeshSieveError>
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.
Sourcepub fn assemble_with_constraints<R, C>(
&mut self,
bases: impl IntoIterator<Item = PointId>,
reducer: &R,
constraints: &C,
) -> Result<(), MeshSieveError>
pub fn assemble_with_constraints<R, C>( &mut self, bases: impl IntoIterator<Item = PointId>, reducer: &R, constraints: &C, ) -> Result<(), MeshSieveError>
Assemble using the provided reducer, then apply constraints.
Sourcepub fn assemble(
&mut self,
bases: impl IntoIterator<Item = PointId>,
) -> Result<(), MeshSieveError>
pub fn assemble( &mut self, bases: impl IntoIterator<Item = PointId>, ) -> Result<(), MeshSieveError>
Backward-compatible assemble: element-wise average of cap slices.
§Migration
Prefer Bundle::assemble_with for explicit reduction control.
Sourcepub fn assemble_with_constraints_default<C>(
&mut self,
bases: impl IntoIterator<Item = PointId>,
constraints: &C,
) -> Result<(), MeshSieveError>
pub fn assemble_with_constraints_default<C>( &mut self, bases: impl IntoIterator<Item = PointId>, constraints: &C, ) -> Result<(), MeshSieveError>
Backward-compatible assemble with constraints using element-wise averaging.