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'}) –

    • '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

    • 'auto' selects the method based on the grid and basis resolution

Methods

build()

Build the transform matrices for each derivative order.

build_pinv()

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.

eq(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

basis

spectral basis for the transform.

built

whether the transform matrices have been built.

built_pinv

whether the pseudoinverse matrix has been built.

derivatives

Set of derivatives the transform can compute.

grid

collocation grid for the transform.

matrices

transform matrices such that x=A*c.

method

method of computing transform.

modes

spectral mode numbers.

nodes

collocation nodes.

num_modes

number of modes in the spectral basis.

num_nodes

number of nodes in the collocation grid.

rcond

reciprocal condition number for inverse transform.