VectorDerivative

Struct VectorDerivative 

Source
pub struct VectorDerivative<const P: usize, const Q: usize, const R: usize> { /* private fields */ }
Expand description

Vector derivative operator ∇

The fundamental differential operator in geometric calculus that combines gradient, divergence, and curl into a single geometric operation.

§Mathematical Background

The vector derivative is defined as:

∇ = e^i ∂_i  (sum over basis vectors)

When applied to fields:

  • Scalar field: ∇f = gradient
  • Vector field: ∇·F = divergence, ∇∧F = curl
  • General: ∇F = ∇·F + ∇∧F (full geometric derivative)

Implementations§

Source§

impl<const P: usize, const Q: usize, const R: usize> VectorDerivative<P, Q, R>

Source

pub fn new(coordinates: CoordinateSystem) -> Self

Create new vector derivative operator

§Arguments
  • coordinates - Coordinate system (Cartesian, spherical, etc.)
§Examples
use amari_calculus::{VectorDerivative, CoordinateSystem};

let nabla = VectorDerivative::<3, 0, 0>::new(CoordinateSystem::Cartesian);
Source

pub fn with_step_size(self, h: f64) -> Self

Set step size for numerical differentiation

Source

pub fn gradient( &self, f: &ScalarField<P, Q, R>, coords: &[f64], ) -> Multivector<P, Q, R>

Compute gradient of scalar field: ∇f

Returns a vector field representing the gradient.

Source

pub fn divergence(&self, f: &VectorField<P, Q, R>, coords: &[f64]) -> f64

Compute divergence of vector field: ∇·F

Returns a scalar representing the divergence.

Source

pub fn curl( &self, f: &VectorField<P, Q, R>, coords: &[f64], ) -> Multivector<P, Q, R>

Compute curl of vector field: ∇∧F

Returns a bivector representing the curl.

Auto Trait Implementations§

§

impl<const P: usize, const Q: usize, const R: usize> Freeze for VectorDerivative<P, Q, R>

§

impl<const P: usize, const Q: usize, const R: usize> RefUnwindSafe for VectorDerivative<P, Q, R>

§

impl<const P: usize, const Q: usize, const R: usize> Send for VectorDerivative<P, Q, R>

§

impl<const P: usize, const Q: usize, const R: usize> Sync for VectorDerivative<P, Q, R>

§

impl<const P: usize, const Q: usize, const R: usize> Unpin for VectorDerivative<P, Q, R>

§

impl<const P: usize, const Q: usize, const R: usize> UnwindSafe for VectorDerivative<P, Q, R>

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.