Trait funspace::space_traits::BaseSpace[][src]

pub trait BaseSpace<A, const N: usize>: Clone where
    A: FloatNum
{ type Physical; type Spectral;
Show 29 methods fn laplace(&self, axis: usize) -> Array2<A>;
fn laplace_inv(&self, axis: usize) -> Array2<A>;
fn laplace_inv_eye(&self, axis: usize) -> Array2<A>;
fn mass(&self, axis: usize) -> Array2<A>;
fn coords_axis(&self, axis: usize) -> Array1<A>;
fn coords(&self) -> [Array1<A>; N];
fn shape_physical(&self) -> [usize; N];
fn shape_spectral(&self) -> [usize; N];
fn ndarray_physical(&self) -> Array<Self::Physical, Dim<[usize; N]>>;
fn ndarray_spectral(&self) -> Array<Self::Spectral, Dim<[usize; N]>>;
fn to_ortho<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn to_ortho_inplace<S1, S2>(
        &self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn from_ortho<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn from_ortho_inplace<S1, S2>(
        &self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn to_ortho_par<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn to_ortho_inplace_par<S1, S2>(
        &self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn from_ortho_par<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn from_ortho_inplace_par<S1, S2>(
        &self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn gradient<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>,
        deriv: [usize; N],
        scale: Option<[A; N]>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn gradient_par<S>(
        &self,
        input: &ArrayBase<S, Dim<[usize; N]>>,
        deriv: [usize; N],
        scale: Option<[A; N]>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn base_all(&self) -> [BaseAll<A>; N];
fn forward<S>(
        &mut self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Physical>
;
fn forward_inplace<S1, S2>(
        &mut self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Physical>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn backward<S>(
        &mut self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Physical, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn backward_inplace<S1, S2>(
        &mut self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Physical> + DataMut
;
fn forward_par<S>(
        &mut self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Spectral, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Physical>
;
fn forward_inplace_par<S1, S2>(
        &mut self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Physical>,
        S2: Data<Elem = Self::Spectral> + DataMut
;
fn backward_par<S>(
        &mut self,
        input: &ArrayBase<S, Dim<[usize; N]>>
    ) -> Array<Self::Physical, Dim<[usize; N]>>
    where
        S: Data<Elem = Self::Spectral>
;
fn backward_inplace_par<S1, S2>(
        &mut self,
        input: &ArrayBase<S1, Dim<[usize; N]>>,
        output: &mut ArrayBase<S2, Dim<[usize; N]>>
    )
    where
        S1: Data<Elem = Self::Spectral>,
        S2: Data<Elem = Self::Physical> + DataMut
;
}

Associated Types

Number type in physical space (float or complex)

Number type in spectral space (float or complex)

Required methods

Laplacian

Arguments
  • axis - usize

Pseudoinverse matrix of Laplacian

Arguments
  • axis - usize

Pseudoidentity matrix of laplacian

Arguments
  • axis - usize

Mass matrix

Arguments
  • axis - usize

Coordinates of grid points (in physical space)

Arguments
  • axis - usize

Array of coordinates

Shape of physical space

Shape of spectral space

Return array where size and type matches physical field

Return array where size and type matches spectral field

Transformation from composite and to orthonormal space.

Arguments
  • input - ndarray with num type of spectral space

Transformation from composite and to orthonormal space (inplace).

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of spectral space

Transformation from orthonormal and to composite space.

Arguments
  • input - ndarray with num type of spectral space

Transformation from orthonormal and to composite space (inplace).

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of spectral space

Transformation from composite and to orthonormal space.

Arguments
  • input - ndarray with num type of spectral space

Transformation from composite and to orthonormal space (inplace).

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of spectral space

Transformation from orthonormal and to composite space.

Arguments
  • input - ndarray with num type of spectral space

Transformation from orthonormal and to composite space (inplace).

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of spectral space

Take gradient. Optional: Rescale result by a constant.

Arguments
  • input - ndarray with num type of spectral space
  • deriv - [usize; N], derivative along each axis
  • scale - [float; N], scaling factor along each axis (default [1.;n])

Take gradient. Optional: Rescale result by a constant. (Parallel)

Arguments
  • input - ndarray with num type of spectral space
  • deriv - [usize; N], derivative along each axis
  • scale - [float; N], scaling factor along each axis (default [1.;n])

Return bases as array of enums

Transform physical -> spectral space

Arguments
  • input - ndarray with num type of physical space
  • output - ndarray with num type of spectral space

Transform physical -> spectral space (inplace)

Arguments
  • input - ndarray with num type of physical space
  • output - ndarray with num type of spectral space

Transform spectral -> physical space

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of physical space

Transform spectral -> physical space (inplace)

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of physical space

Transform physical -> spectral space

Arguments
  • input - ndarray with num type of physical space
  • output - ndarray with num type of spectral space

Transform physical -> spectral space (inplace)

Arguments
  • input - ndarray with num type of physical space
  • output - ndarray with num type of spectral space

Transform spectral -> physical space

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of physical space

Transform spectral -> physical space (inplace)

Arguments
  • input - ndarray with num type of spectral space
  • output - ndarray with num type of physical space

Implementors