pub struct SobolevSpace {
pub n: usize,
pub dx: f64,
pub k: usize,
}Expand description
A discrete Sobolev space H^k on a uniform grid.
Provides H^k norms, weak derivative approximation (finite differences), and trace operator evaluation.
Fields§
§n: usizeNumber of grid points.
dx: f64Grid spacing.
k: usizeSobolev order k.
Implementations§
Source§impl SobolevSpace
impl SobolevSpace
Sourcepub fn new(n: usize, dx: f64, k: usize) -> Self
pub fn new(n: usize, dx: f64, k: usize) -> Self
Create a new SobolevSpace with n points, spacing dx, and order k.
Sourcepub fn norm(&self, f: &[f64]) -> f64
pub fn norm(&self, f: &[f64]) -> f64
Compute the H^k norm using finite-difference weak derivatives.
‖f‖²_{H^k} = Σ_{j=0}^{k} ‖D^j f‖²_{L²}
Sourcepub fn weak_derivative(f: &[f64], dx: f64) -> Vec<f64>
pub fn weak_derivative(f: &[f64], dx: f64) -> Vec<f64>
Compute the first-order weak derivative using central differences.
Forward/backward differences are used at the boundary.
Sourcepub fn trace(&self, f: &[f64]) -> [f64; 2]
pub fn trace(&self, f: &[f64]) -> [f64; 2]
Evaluate the trace operator: return the boundary values \[f(0), f(n-1)\].
Sourcepub fn is_in_space(&self, f: &[f64]) -> bool
pub fn is_in_space(&self, f: &[f64]) -> bool
Check whether f lies in H^k (finite H^k norm).
Sourcepub fn inner_product(&self, f: &[f64], g: &[f64]) -> f64
pub fn inner_product(&self, f: &[f64], g: &[f64]) -> f64
Compute the H^k inner product ⟨f, g⟩_{H^k} = Σ_{j=0}^{k} ⟨D^j f, D^j g⟩.
Trait Implementations§
Source§impl Clone for SobolevSpace
impl Clone for SobolevSpace
Source§fn clone(&self) -> SobolevSpace
fn clone(&self) -> SobolevSpace
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SobolevSpace
impl RefUnwindSafe for SobolevSpace
impl Send for SobolevSpace
impl Sync for SobolevSpace
impl Unpin for SobolevSpace
impl UnsafeUnpin for SobolevSpace
impl UnwindSafe for SobolevSpace
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.