Skip to main content

MetricProvider

Trait MetricProvider 

Source
pub trait MetricProvider<R>
where R: CfdScalar + ConjugateScalar<Real = R>,
{ // Required methods fn dims(&self) -> (usize, usize); fn sample<F>(&self, f: F) -> Result<CausalTensorTrain<R>, PhysicsError> where F: Fn(R, R) -> R; fn physical_gradient( &self, u: &CausalTensorTrain<R>, ) -> Result<(CausalTensorTrain<R>, CausalTensorTrain<R>), PhysicsError>; fn jacobian(&self) -> &CausalTensorTrain<R>; }
Expand description

A structured curvilinear coordinate over a 2^Lx × 2^Ly computational lattice, supplying the pieces a compressible marcher needs: field sampling, the chain-rule physical gradient, and the Jacobian volume factor — all carried as low-rank tensor trains. Static dispatch only (used as a generic bound).

Required Methods§

Source

fn dims(&self) -> (usize, usize)

The computational lattice mode counts (Lx, Ly) (grid is 2^Lx × 2^Ly).

Source

fn sample<F>(&self, f: F) -> Result<CausalTensorTrain<R>, PhysicsError>
where F: Fn(R, R) -> R,

Sample f(ξ, η) on the computational lattice (ξ_i = i/Nx, η_j = j/Ny) and QTT-encode it.

§Errors

Propagates sampling / codec errors.

Source

fn physical_gradient( &self, u: &CausalTensorTrain<R>, ) -> Result<(CausalTensorTrain<R>, CausalTensorTrain<R>), PhysicsError>

The physical gradient (∂u/∂x, ∂u/∂y) of a field u carried in this coordinate, via the chain rule and the low-rank metric.

§Errors

Propagates apply / Hadamard / rounding errors.

Source

fn jacobian(&self) -> &CausalTensorTrain<R>

The Jacobian determinant |J| (the conservative volume factor) as a low-rank tensor train.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> MetricProvider<R> for BlendedMap<R>
where R: CfdScalar + ConjugateScalar<Real = R>,

Source§

impl<R> MetricProvider<R> for BodyFittedCoordinate<R>
where R: CfdScalar + ConjugateScalar<Real = R>,

Source§

impl<R> MetricProvider<R> for CartesianIdentity<R>
where R: CfdScalar + ConjugateScalar<Real = R>,