Skip to main content

VectorField

Trait VectorField 

Source
pub trait VectorField {
    // Required method
    fn at(&self, p: LengthVec, t: Time) -> DVec3;

    // Provided methods
    fn divergence(&self, p: LengthVec, t: Time, h: Length) -> f64 { ... }
    fn curl(&self, p: LengthVec, t: Time, h: Length) -> DVec3 { ... }
}
Expand description

A vector field: velocity, force per volume, electric field, heat flux.

Required Methods§

Source

fn at(&self, p: LengthVec, t: Time) -> DVec3

The value at a place and time, in this field’s SI base unit.

Provided Methods§

Source

fn divergence(&self, p: LengthVec, t: Time, h: Length) -> f64

∇·F — net outflow per unit volume. Zero everywhere means nothing is being created or destroyed, which is how a conservation law is written locally.

Source

fn curl(&self, p: LengthVec, t: Time, h: Length) -> DVec3

∇×F — local rotation. Zero everywhere means the field is a gradient of something, which is why an electrostatic field has a potential and a magnetic one does not.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§