Skip to main content

MultiSection

Struct MultiSection 

Source
pub struct MultiSection<V, S: Storage<V>> { /* private fields */ }
Expand description

Group multiple field sections with consistent per-point offsets.

Implementations§

Source§

impl<V, S> MultiSection<V, S>
where S: Storage<V>,

Source

pub fn new(fields: Vec<FieldSection<V, S>>) -> Result<Self, MeshSieveError>

Construct a multi-section from field sections.

All fields must share the same point set. Per-point total DOFs are the sum of field DOFs, in field order.

Source

pub fn atlas(&self) -> &Atlas

Borrow the combined atlas.

Source

pub fn field_count(&self) -> usize

Number of fields.

Source

pub fn fields(&self) -> &[FieldSection<V, S>]

Borrow all fields.

Source

pub fn fields_mut(&mut self) -> &mut [FieldSection<V, S>]

Mutable access to all fields.

Source

pub fn field(&self, index: usize) -> Option<&FieldSection<V, S>>

Borrow a field by index.

Source

pub fn field_mut(&mut self, index: usize) -> Option<&mut FieldSection<V, S>>

Mutable access to a field by index.

Source

pub fn field_by_name(&self, name: &str) -> Option<&FieldSection<V, S>>

Borrow a field by name.

Source

pub fn field_by_name_mut( &mut self, name: &str, ) -> Option<&mut FieldSection<V, S>>

Mutable access to a field by name.

Source

pub fn dof(&self, p: PointId) -> Result<usize, MeshSieveError>

Total DOF count at point p across all fields.

Source

pub fn offset(&self, p: PointId) -> Result<usize, MeshSieveError>

Offset for point p in the combined layout.

Source

pub fn field_dof( &self, p: PointId, field: usize, ) -> Result<usize, MeshSieveError>

DOF count for a specific field at point p.

Source

pub fn field_offset( &self, p: PointId, field: usize, ) -> Result<usize, MeshSieveError>

Field offset for point p in the combined layout.

This mirrors PetscSection field offsets: offset(p) + sum_{i < field} dof_i(p).

Source

pub fn field_span( &self, p: PointId, field: usize, ) -> Result<(usize, usize), MeshSieveError>

(offset, dof) pair for a field at point p.

Source

pub fn field_dof_by_name( &self, p: PointId, name: &str, ) -> Result<usize, MeshSieveError>

DOF count for a field at point p, by field name.

Source

pub fn field_offset_by_name( &self, p: PointId, name: &str, ) -> Result<usize, MeshSieveError>

Field offset for point p, by field name.

Source

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

Apply constraints for all fields.

Source§

impl<V, S> MultiSection<V, S>
where V: Clone, S: Storage<V>,

Source

pub fn gather_in_order(&self) -> Result<Vec<V>, MeshSieveError>

Gather all fields into a flat buffer in combined atlas order.

Source

pub fn try_scatter_in_order(&mut self, buf: &[V]) -> Result<(), MeshSieveError>
where V: Clone + Default,

Scatter values from a flat buffer in combined atlas order.

Trait Implementations§

Source§

impl<V: Clone, S: Clone + Storage<V>> Clone for MultiSection<V, S>

Source§

fn clone(&self) -> MultiSection<V, S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug, S: Debug + Storage<V>> Debug for MultiSection<V, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V, S> Freeze for MultiSection<V, S>

§

impl<V, S> RefUnwindSafe for MultiSection<V, S>

§

impl<V, S> Send for MultiSection<V, S>
where S: Send, V: Send,

§

impl<V, S> Sync for MultiSection<V, S>
where S: Sync, V: Sync,

§

impl<V, S> Unpin for MultiSection<V, S>
where S: Unpin, V: Unpin,

§

impl<V, S> UnsafeUnpin for MultiSection<V, S>

§

impl<V, S> UnwindSafe for MultiSection<V, S>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PayloadLike for T
where T: Clone,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.