Skip to main content

Analytic

Struct Analytic 

Source
pub struct Analytic<F>(pub F);
Expand description

A field from a closure, for the common case where the physics is a formula.

Tuple Fields§

§0: F

Trait Implementations§

Source§

impl<F: Fn(LengthVec, Time) -> f64> ScalarField for Analytic<F>

Source§

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

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

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

∇f, by central differences over h. Units are the field’s per metre.
Source§

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

∇²f — the operator that makes diffusion diffuse. A point hotter than the average of its neighbours has a negative Laplacian and cools; that is the whole content of the heat equation.
Source§

fn rate(&self, p: LengthVec, t: Time, dt: Time) -> f64

∂f/∂t, by a central difference in time.
Source§

impl<F: Fn(LengthVec, Time) -> DVec3> VectorField for Analytic<F>

Source§

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

The value at a place and time, in this field’s SI base unit.
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.

Auto Trait Implementations§

§

impl<F> Freeze for Analytic<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for Analytic<F>
where F: RefUnwindSafe,

§

impl<F> Send for Analytic<F>
where F: Send,

§

impl<F> Sync for Analytic<F>
where F: Sync,

§

impl<F> Unpin for Analytic<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for Analytic<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for Analytic<F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.