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§
Sourcefn dims(&self) -> (usize, usize)
fn dims(&self) -> (usize, usize)
The computational lattice mode counts (Lx, Ly) (grid is 2^Lx × 2^Ly).
Sourcefn sample<F>(&self, f: F) -> Result<CausalTensorTrain<R>, PhysicsError>where
F: Fn(R, R) -> R,
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.
Sourcefn physical_gradient(
&self,
u: &CausalTensorTrain<R>,
) -> Result<(CausalTensorTrain<R>, CausalTensorTrain<R>), PhysicsError>
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.
Sourcefn jacobian(&self) -> &CausalTensorTrain<R>
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".