Skip to main content

TimeField

Struct TimeField 

Source
pub struct TimeField { /* private fields */ }
Expand description

Real field samples on a domain over a uniform time axis.

Implementations§

Source§

impl TimeField

Source

pub fn new( domain: Arc<Domain>, quantity: FieldQuantity, rank: Rank, time: TimeAxis, values: Array3<f64>, ) -> Result<Self, ErrorsJSL>

A field from a (steps, samples, components) array; vector fields need a linear basis.

Source

pub fn from_fn( domain: Arc<Domain>, quantity: FieldQuantity, rank: Rank, time: TimeAxis, f: impl Fn(&Position, f64) -> Vec<f64>, ) -> Result<Self, ErrorsJSL>

A field sampled from a function of position and time returning rank.components() values.

Source

pub fn domain(&self) -> &Arc<Domain> ⓘ

Source

pub fn quantity(&self) -> FieldQuantity

Source

pub fn rank(&self) -> Rank

Source

pub fn basis(&self) -> Option<PolarizationBasis>

Source

pub fn time_axis(&self) -> TimeAxis

Source

pub fn values(&self) -> &Array3<f64>

Source

pub fn values_mut(&mut self) -> &mut Array3<f64>

Source

pub fn at(&self, step: usize, sample: usize) -> Vec<f64>

The components at one time step and sample.

Source

pub fn harmonic_at( &self, frequency: f64, convention: TimeConvention, ) -> Result<HarmonicField, ErrorsJSL>

The harmonic component at frequency by projection over the time axis: X = (2/N) Σ x(t) e^{∓jωt}, exact when the axis spans a whole number of periods. frequency must be positive.

Source§

impl TimeField

Source

pub fn sample_at( &self, p: &Position, method: InterpolationMethod, ) -> Result<Vec<Vec<f64>>, ErrorsJSL>

The field at p for every time step, components in the field’s basis at p.

Source

pub fn resample_to( &self, domain: Arc<Domain>, method: InterpolationMethod, outside: Extrapolation, ) -> Result<TimeField, ErrorsJSL>

The field resampled onto domain.

Source§

impl TimeField

Source

pub fn surface_gradient(&self) -> Result<TimeField, ErrorsJSL>

∇ₛ f of a scalar time field at every step.

Source

pub fn surface_divergence(&self) -> Result<TimeField, ErrorsJSL>

∇ₛ·F of the tangential part of a vector time field.

Source

pub fn surface_curl(&self) -> Result<TimeField, ErrorsJSL>

n̂·∇×F of the tangential part of a vector time field.

Source

pub fn laplace_beltrami(&self) -> Result<TimeField, ErrorsJSL>

Δₛ f of a scalar time field.

Source§

impl TimeField

Source

pub fn to_basis(&self, basis: PolarizationBasis) -> Result<TimeField, ErrorsJSL>

The same vector field with components in another linear basis.

Source

pub fn transformed( &self, transform: &RigidTransform, method: InterpolationMethod, outside: Extrapolation, ) -> Result<TimeField, ErrorsJSL>

Applies a rigid transform (resampling through T⁻¹). Far-field time series can only be rotated: a translation would need a time delay rather than a phase.

Source§

impl TimeField

Source

pub fn gradient(&self) -> Result<TimeField, ErrorsJSL>

∇f of a scalar time field, at every time step.

Source

pub fn divergence(&self) -> Result<TimeField, ErrorsJSL>

∇·F of a vector time field.

Source

pub fn curl(&self) -> Result<TimeField, ErrorsJSL>

∇×F of a vector time field.

Source

pub fn time_derivative(&self) -> Result<TimeField, ErrorsJSL>

∂F/∂t by second-order finite differences in time (one-sided at the ends).

Trait Implementations§

Source§

impl Clone for TimeField

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TimeField

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TimeField

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TimeField

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> MaybeSerialize for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.