desc.transform.Transform
- class desc.transform.Transform(grid, basis, derivs=0, rcond='auto', build=True, build_pinv=False, method='auto')Source
Transforms from spectral coefficients to real space values.
- Parameters:
grid (Grid) – Collocation grid of real space coordinates
basis (Basis) – Spectral basis of modes
derivs (int or array-like) –
if an int, order of derivatives needed (default=0)
if an array, derivative orders specified explicitly. Shape should be (N,3), where each row is one set of partial derivatives [dr, dt, dz]
rcond (float) – relative cutoff for singular values for inverse fitting
build (bool) – whether to precompute the transforms now or do it later
build_pinv (bool) – whether to precompute the pseudoinverse now or do it later
method ({
`'auto'
, ‘fft’`,'direct1'
,'direct2'
,'jitable'
}) –'fft'
uses fast fourier transforms in the zeta direction, and so must have equally spaced toroidal nodes, and the same node pattern on each zeta plane.'direct1'
uses full matrices and can handle arbitrary node patterns and spectral bases.'direct2'
uses a DFT instead of FFT that can be faster in practice.'jitable'
is the same as'direct1'
but avoids some checks, allowing you to create transforms inside JIT compiled functions.'auto'
selects the method based on the grid and basis resolution.
Methods
build
()Build the transform matrices for each derivative order.
Build the pseudoinverse for fitting.
change_derivatives
(derivs[, build])Change the order and updates the matrices accordingly.
change_resolution
([grid, basis, build, ...])Re-build the matrices with a new grid and basis.
copy
([deepcopy])Return a (deep)copy of this object.
equiv
(other)Compare equivalence between DESC objects.
fit
(x)Transform from physical domain to spectral using weighted least squares fit.
load
(load_from[, file_format])Initialize from file.
project
(y)Project vector y onto basis.
save
(file_name[, file_format, file_mode])Save the object.
transform
(c[, dr, dt, dz])Transform from spectral domain to physical.
Attributes
spectral basis for the transform.
whether the transform matrices have been built.
whether the pseudoinverse matrix has been built.
Set of derivatives the transform can compute.
collocation grid for the transform.
transform matrices such that x=A*c.
method of computing transform.
spectral mode numbers.
collocation nodes.
number of modes in the spectral basis.
number of nodes in the collocation grid.
reciprocal condition number for inverse transform.