Skip to main content

MatrixGridFn1D

Struct MatrixGridFn1D 

Source
pub struct MatrixGridFn1D<F: SemiflowFloat = f64, const M: usize = 2> {
    pub grid: Grid1D<F>,
    pub values: Vec<F>,
}
Expand description

Multi-component grid state: u : Grid₁D → ℝᴹ.

Internal layout: row-major flat Vec<F> of length N * M; component i at grid point k is at index k * M + i. Optimal for the per-grid-point matrix-vector multiply in Phase 2 (math §33.3).

Implements State<F> with per-component delegation (math §33.2, ADR-0082).

§Generic parameters

  • F: SemiflowFloat — scalar float type (default f64).
  • M: usize — number of coupled components (const generic).

Fields§

§grid: Grid1D<F>

Reference grid geometry (immutable after construction).

§values: Vec<F>

Row-major flat values: values[k * M + i] = component i at node k.

Implementations§

Source§

impl<F: SemiflowFloat, const M: usize> MatrixGridFn1D<F, M>

Source

pub fn new(grid: Grid1D<F>) -> Self

Create a zero-valued state on grid.

Source

pub fn from_fn(grid: Grid1D<F>, f: impl FnMut(F) -> [F; M]) -> Self

Create from a pointwise closure f(x) -> [F; M].

Source

pub fn point_view(&self, k: usize) -> [F; M]

Read the M-component vector at grid point k.

Source

pub fn set_point(&mut self, k: usize, val: &[F; M])

Write an M-component vector at grid point k.

Trait Implementations§

Source§

impl<F: Clone + SemiflowFloat, const M: usize> Clone for MatrixGridFn1D<F, M>

Source§

fn clone(&self) -> Self

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<F: Debug + SemiflowFloat, const M: usize> Debug for MatrixGridFn1D<F, M>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<F: SemiflowFloat, const M: usize> State<F> for MatrixGridFn1D<F, M>

Source§

fn len(&self) -> usize

Number of degrees of freedom (grid nodes, graph nodes, etc.).
Source§

fn axpy_into(&mut self, alpha: F, src: &Self)

In-place AXPY: self ← self + alpha · src. No allocation. Read more
Source§

fn copy_from(&mut self, src: &Self)

Node-wise copy: self ← src. No allocation. Read more
Source§

fn zero_into(&mut self)

Zero all nodes: self[i] ← 0 for all i. len() unchanged.
Source§

fn norm_sup(&self) -> F

Sup-norm ‖self‖_∞ = max_i |self[i]|. Read more
Source§

fn scale_into(&mut self, k: F)

In-place scale: self ← k · self. Read more
Source§

fn is_empty(&self) -> bool

Returns true if this state has no nodes.

Auto Trait Implementations§

§

impl<F, const M: usize> Freeze for MatrixGridFn1D<F, M>
where Grid1D<F>: Freeze, Vec<F>: Freeze,

§

impl<F, const M: usize> RefUnwindSafe for MatrixGridFn1D<F, M>

§

impl<F, const M: usize> Send for MatrixGridFn1D<F, M>
where Grid1D<F>: Send, Vec<F>: Send,

§

impl<F, const M: usize> Sync for MatrixGridFn1D<F, M>
where Grid1D<F>: Sync, Vec<F>: Sync,

§

impl<F, const M: usize> Unpin for MatrixGridFn1D<F, M>
where Grid1D<F>: Unpin, Vec<F>: Unpin,

§

impl<F, const M: usize> UnsafeUnpin for MatrixGridFn1D<F, M>

§

impl<F, const M: usize> UnwindSafe for MatrixGridFn1D<F, M>

Blanket Implementations§

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.