pub struct FourierC2c<A> { /* private fields */ }
Expand description

Implementations

Returns a new Fourier Basis for complex-to-complex transforms

Equispaced points on intervall [0, 2pi[

Panics

Float conversion fails

Return complex wavenumber vector(0, 1, 2, -3, -2, -1)

Panics

Float conversion fails

Trait Implementations

Real valued scalar type

Return kind of base

Return kind of transform

Coordinates in physical space

Composite space coefficients -> Orthogonal space coefficients

Orthogonal space coefficients -> Composite space coefficients

Composite coefficients -> Orthogonal coefficients

Composite coefficients -> Orthogonal coefficients

Composite coefficients -> Orthogonal coefficients

Composite coefficients -> Orthogonal coefficients

Composite coefficients -> Orthogonal coefficients (Parallel)

Composite coefficients -> Orthogonal coefficients (Parallel)

Composite coefficients -> Orthogonal coefficients (Parallel)

Composite coefficients -> Orthogonal coefficients (Parallel)

Differentiate along slice

use funspace::traits::BaseGradient;
use funspace::fourier::FourierC2c;
use funspace::utils::approx_eq_complex;
use num_complex::Complex;
use num_traits::Zero;
let fo = FourierC2c::<f64>::new(5);
let mut k = FourierC2c::<f64>::wavenumber(5);
let expected: Vec<Complex<f64>> = k.iter().map(|x| x.powi(2)).collect();
let mut outdata = vec![Complex::<f64>::zero(); 5];
fo.gradient_slice(&k, &mut outdata, 1);
approx_eq_complex(&outdata, &expected);
Panics

When type conversion fails ( safe )

Differentiate in spectral space

Differentiate in spectral space

Differentiate in spectral space

Differentiate in spectral space

Scalar type of matrix

Explicit differential operator $ D $

Matrix-based version of BaseGradient::gradient()

Panics

Type conversion fails

Explicit inverse of differential operator $ D^* $

Returns (D_pinv, I_pinv), where D_pinv is the pseudoinverse and I_pinv the corresponding pseudoidentity matrix, such that

D_pinv @ D = I_pinv

Can be used as a preconditioner.

Scalar type of laplacian matrix

Laplacian $ L $

Pseudoinverse matrix of Laplacian $ L^{-1} $

Returns pseudoinverse and pseudoidentity,i.e (D_pinv, I_pinv)

D_pinv @ D = I_pinv
``

Scalar type of matrix

Transformation stencil composite -> orthogonal space

Inverse of transformation stencil

Size in physical space

Size in spectral space

Size of orthogonal space

Example

Forward transform

use funspace::traits::BaseTransform;
use funspace::fourier::FourierC2c;
use funspace::utils::approx_eq_complex;
use num_complex::Complex;
use num_traits::Zero;
let mut fo = FourierC2c::<f64>::new(4);
let indata = vec![
    Complex::new(1., 1.),
    Complex::new(2., 2.),
    Complex::new(3., 3.),
    Complex::new(4., 4.)
];
let expected = vec![
    Complex::new(10., 10.),
    Complex::new(-4., 0.),
    Complex::new(-2., -2.),
    Complex::new(0., -4.)
];
let mut outdata = vec![Complex::<f64>::zero(); 4];
fo.forward_slice(&indata, &mut outdata);
approx_eq_complex(&outdata, &expected);
Example

Backward transform

use funspace::traits::BaseTransform;
use funspace::fourier::FourierC2c;
use funspace::utils::approx_eq_complex;
use num_complex::Complex;
use num_traits::Zero;
let mut fo = FourierC2c::<f64>::new(4);
let indata = vec![
    Complex::new(10., 10.),
    Complex::new(-4., 0.),
    Complex::new(-2., -2.),
    Complex::new(0., -4.)
];
let expected = vec![
    Complex::new(1., 1.),
    Complex::new(2., 2.),
    Complex::new(3., 3.),
    Complex::new(4., 4.)
];
let mut outdata = vec![Complex::<f64>::zero(); 4];
fo.backward_slice(&indata, &mut outdata);
approx_eq_complex(&outdata, &expected);

Scalar type in physical space

Scalar type in spectral space

Physical values -> Spectral coefficients

Physical values -> Spectral coefficients

Spectral coefficients -> Physical values

Spectral coefficients -> Physical values

Physical values -> Spectral coefficients (Parallel)

Physical values -> Spectral coefficients (Parallel)

Spectral coefficients -> Physical values (Parallel)

Spectral coefficients -> Physical values (Parallel)

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.