pub struct TimeField { /* private fields */ }Expand description
Real field samples on a domain over a uniform time axis.
Implementations§
Source§impl TimeField
impl TimeField
Sourcepub fn new(
domain: Arc<Domain>,
quantity: FieldQuantity,
rank: Rank,
time: TimeAxis,
values: Array3<f64>,
) -> Result<Self, ErrorsJSL>
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.
Sourcepub fn from_fn(
domain: Arc<Domain>,
quantity: FieldQuantity,
rank: Rank,
time: TimeAxis,
f: impl Fn(&Position, f64) -> Vec<f64>,
) -> Result<Self, ErrorsJSL>
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.
pub fn domain(&self) -> &Arc<Domain> ⓘ
pub fn quantity(&self) -> FieldQuantity
pub fn rank(&self) -> Rank
pub fn basis(&self) -> Option<PolarizationBasis>
pub fn time_axis(&self) -> TimeAxis
pub fn values(&self) -> &Array3<f64>
pub fn values_mut(&mut self) -> &mut Array3<f64>
Sourcepub fn at(&self, step: usize, sample: usize) -> Vec<f64>
pub fn at(&self, step: usize, sample: usize) -> Vec<f64>
The components at one time step and sample.
Sourcepub fn harmonic_at(
&self,
frequency: f64,
convention: TimeConvention,
) -> Result<HarmonicField, ErrorsJSL>
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
impl TimeField
Sourcepub fn sample_at(
&self,
p: &Position,
method: InterpolationMethod,
) -> Result<Vec<Vec<f64>>, ErrorsJSL>
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.
Sourcepub fn resample_to(
&self,
domain: Arc<Domain>,
method: InterpolationMethod,
outside: Extrapolation,
) -> Result<TimeField, ErrorsJSL>
pub fn resample_to( &self, domain: Arc<Domain>, method: InterpolationMethod, outside: Extrapolation, ) -> Result<TimeField, ErrorsJSL>
The field resampled onto domain.
Source§impl TimeField
impl TimeField
Sourcepub fn surface_gradient(&self) -> Result<TimeField, ErrorsJSL>
pub fn surface_gradient(&self) -> Result<TimeField, ErrorsJSL>
∇ₛ f of a scalar time field at every step.
Sourcepub fn surface_divergence(&self) -> Result<TimeField, ErrorsJSL>
pub fn surface_divergence(&self) -> Result<TimeField, ErrorsJSL>
∇ₛ·F of the tangential part of a vector time field.
Sourcepub fn surface_curl(&self) -> Result<TimeField, ErrorsJSL>
pub fn surface_curl(&self) -> Result<TimeField, ErrorsJSL>
n̂·∇×F of the tangential part of a vector time field.
Sourcepub fn laplace_beltrami(&self) -> Result<TimeField, ErrorsJSL>
pub fn laplace_beltrami(&self) -> Result<TimeField, ErrorsJSL>
Δₛ f of a scalar time field.
Source§impl TimeField
impl TimeField
Sourcepub fn to_basis(&self, basis: PolarizationBasis) -> Result<TimeField, ErrorsJSL>
pub fn to_basis(&self, basis: PolarizationBasis) -> Result<TimeField, ErrorsJSL>
The same vector field with components in another linear basis.
Sourcepub fn transformed(
&self,
transform: &RigidTransform,
method: InterpolationMethod,
outside: Extrapolation,
) -> Result<TimeField, ErrorsJSL>
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
impl TimeField
Sourcepub fn gradient(&self) -> Result<TimeField, ErrorsJSL>
pub fn gradient(&self) -> Result<TimeField, ErrorsJSL>
∇f of a scalar time field, at every time step.
Sourcepub fn divergence(&self) -> Result<TimeField, ErrorsJSL>
pub fn divergence(&self) -> Result<TimeField, ErrorsJSL>
∇·F of a vector time field.
Sourcepub fn time_derivative(&self) -> Result<TimeField, ErrorsJSL>
pub fn time_derivative(&self) -> Result<TimeField, ErrorsJSL>
∂F/∂t by second-order finite differences in time (one-sided at the ends).