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
Required methods
fn laplace_inv(&self, axis: usize) -> Array2<A>
fn laplace_inv(&self, axis: usize) -> Array2<A>
fn laplace_inv_eye(&self, axis: usize) -> Array2<A>
fn laplace_inv_eye(&self, axis: usize) -> Array2<A>
fn coords_axis(&self, axis: usize) -> Array1<A>
fn coords_axis(&self, axis: usize) -> Array1<A>
fn shape_physical(&self) -> [usize; N]
fn shape_physical(&self) -> [usize; N]
Shape of physical space
fn shape_spectral(&self) -> [usize; N]
fn shape_spectral(&self) -> [usize; N]
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 spaceoutput
- 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 spaceoutput
- 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 spaceoutput
- 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 spaceoutput
- ndarray with num type of spectral space
Take gradient. Optional: Rescale result by a constant.
Arguments
input
- ndarray with num type of spectral spacederiv
- [usize; N], derivative along each axisscale
- [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 spacederiv
- [usize; N], derivative along each axisscale
- [float; N], scaling factor along each axis (default [1.;n])
Transform physical -> spectral space
Arguments
input
- ndarray with num type of physical spaceoutput
- ndarray with num type of spectral space
Transform physical -> spectral space (inplace)
Arguments
input
- ndarray with num type of physical spaceoutput
- ndarray with num type of spectral space
Transform spectral -> physical space
Arguments
input
- ndarray with num type of spectral spaceoutput
- ndarray with num type of physical space
Transform spectral -> physical space (inplace)
Arguments
input
- ndarray with num type of spectral spaceoutput
- ndarray with num type of physical space
Transform physical -> spectral space
Arguments
input
- ndarray with num type of physical spaceoutput
- ndarray with num type of spectral space
Transform physical -> spectral space (inplace)
Arguments
input
- ndarray with num type of physical spaceoutput
- ndarray with num type of spectral space
Transform spectral -> physical space
Arguments
input
- ndarray with num type of spectral spaceoutput
- ndarray with num type of physical space
Transform spectral -> physical space (inplace)
Arguments
input
- ndarray with num type of spectral spaceoutput
- ndarray with num type of physical space