pub struct FreePatchFlowBasis { /* private fields */ }Expand description
Truncated polynomial vector-field basis on a d = 2 Euclidean patch,
v_{c,(a,b)}(t) = e_c · u₀^a · u₁^b where u = (t − center) ⊙ inv_half ∈ [−1, 1]² is the affinely-normalized patch coordinate (conditioning: the raw
t box can be far from [−1, 1]). Because the patch is contractible
there is no hairy-ball obstruction — these are smooth global vector fields,
so the flow φ_θ(t) = t + Σ_k θ_k v_k(t) parameterizes a neighborhood of
the identity in Diff(patch) exactly the way the Fourier basis does on the
torus, and any such map with det Dφ > 0 on the patch is a diffeomorphism
onto its image. The reference metric is the flat g_ref = I (uniform-speed
coordinates), so the canonical chart is the minimum-anisotropy-defect one.
Implementations§
Source§impl FreePatchFlowBasis
impl FreePatchFlowBasis
Sourcepub fn new(lo: [f64; 2], hi: [f64; 2]) -> Result<Self, String>
pub fn new(lo: [f64; 2], hi: [f64; 2]) -> Result<Self, String>
Build the basis for the patch box [lo, hi] per axis. Returns an error
when an axis has collapsed (hi ≤ lo) — a patch with no extent in some
direction has no honest flat chart.
Sourcepub fn mode_layout(&self) -> Vec<PatchFlowModeKey>
pub fn mode_layout(&self) -> Vec<PatchFlowModeKey>
Mode identities in coefficient order (for each component, each monomial).
This IS the θ index layout — Self::mode_samples matches it.
Sourcepub fn mode_samples(&self, t: [f64; 2]) -> Vec<FlowModeSample>
pub fn mode_samples(&self, t: [f64; 2]) -> Vec<FlowModeSample>
Sample every mode (value + gradient in t) at chart point t, in
θ order. The monomial f(u) = u₀^a · u₁^b has ∂f/∂t_d = (∂f/∂u_d)·(∂u_d/∂t_d) = (∂f/∂u_d)·inv_half[d] by the chain rule, so the
returned gradient is already in the chart coordinate the flow Jacobian
Dφ = I + Σ θ_k ∂v_k/∂t lives in.
Sourcepub fn map_point(&self, theta: &[f64], t: [f64; 2]) -> [f64; 2]
pub fn map_point(&self, theta: &[f64], t: [f64; 2]) -> [f64; 2]
φ_θ(t) = t + Σ_k θ_k v_k(t) (no wrap — the patch is not periodic).
Sourcepub fn flow_jacobian(&self, theta: &[f64], t: [f64; 2]) -> [[f64; 2]; 2]
pub fn flow_jacobian(&self, theta: &[f64], t: [f64; 2]) -> [[f64; 2]; 2]
Flow Jacobian Dφ_θ(t) = I + Σ_k θ_k Dv_k(t), row-major.
Sourcepub fn min_jacobian_det_on_grid(&self, theta: &[f64]) -> f64
pub fn min_jacobian_det_on_grid(&self, theta: &[f64]) -> f64
Minimum of det Dφ_θ over the widened normalized check grid [−1.1, 1.1]² (in t coordinates) — the diffeomorphism guard’s decision
quantity. The grid is built in t by inverting the normalization.
Trait Implementations§
Source§impl Clone for FreePatchFlowBasis
impl Clone for FreePatchFlowBasis
Source§fn clone(&self) -> FreePatchFlowBasis
fn clone(&self) -> FreePatchFlowBasis
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FreePatchFlowBasis
impl RefUnwindSafe for FreePatchFlowBasis
impl Send for FreePatchFlowBasis
impl Sync for FreePatchFlowBasis
impl Unpin for FreePatchFlowBasis
impl UnsafeUnpin for FreePatchFlowBasis
impl UnwindSafe for FreePatchFlowBasis
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.