dedalus.core.basis

Abstract and built-in classes for spectral bases.

Module Contents

class Jacobi(coord, size, bounds, a, b, a0=None, b0=None, dealias=1, library=None)

Jacobi polynomial basis.

group_shape = [1]
native_bounds
transforms
transform_plan(grid_size)

Build transform plan.

elements_to_groups(grid_space, elements)
valid_elements(tensorsig, grid_space, elements)
Jacobi_matrix(size)
product_matrix(arg_basis, out_basis, i)
derivative_basis(order=1)
Legendre(*args, **kw)
Ultraspherical(*args, alpha, alpha0=None, **kw)
ChebyshevT(*args, **kw)
ChebyshevU(*args, **kw)
ChebyshevV(*args, **kw)
Chebyshev
Fourier(*args, dtype=None, **kw)

Factory function dispatching to RealFourier and ComplexFourier based on provided dtype.

class ComplexFourier(coord, size, bounds, dealias=1, library=None)

Fourier complex exponential basis. Modes: [exp(0j*x), exp(1j*x), exp(2j*x), …]

group_shape = [1]
transforms
valid_elements(tensorsig, grid_space, elements)
product_matrix(arg_basis, out_basis, i)
class RealFourier(coord, size, bounds, dealias=1, library=None)

Fourier real sine/cosine basis. Modes: [cos(0*x), -sin(0*x), cos(1*x), -sin(1*x), …]

group_shape = [2]
transforms
valid_elements(tensorsig, grid_space, elements)
product_matrix(arg_basis, out_basis, i)
class AnnulusBasis(coordsystem, shape, dtype, radii=(1, 2), k=0, alpha=(- 0.5, - 0.5), dealias=(1, 1), radius_library=None, azimuth_library=None)

Abstract base class for spectral bases.

transforms
subaxis_dependence = [False, True]
radial_basis()
global_grid_radius(scale)
local_grid_radius(scale)
global_radius_weights(scale=None)
local_radius_weights(scale=None)
constant_mode_value()
transform_plan(grid_size, k)

Build transform plan.

radial_transform_factor(scale, data_axis, dk)
forward_transform_radius(field, axis, gdata, cdata)
backward_transform_radius(field, axis, cdata, gdata)
interpolation(m, spintotal, position)
operator_matrix(op, m, spintotal, size=None)
jacobi_conversion(m, dk, size=None)
conversion_matrix(m, spintotal, dk)
class DiskBasis(coordsystem, shape, dtype, radius=1, k=0, alpha=0, dealias=(1, 1), radius_library=None, azimuth_library=None)

Abstract base class for spectral bases.

transforms
subaxis_dependence = [True, True]
radial_basis()
global_grid_radius(scale)
local_grid_radius(scale)
global_radius_weights(scale=None)
local_radius_weights(scale=None)
constant_mode_value()
transform_plan(grid_shape, axis, s)

Build transform plan.

abstract forward_transform_radius_Nmax0(field, axis, gdata, cdata)
forward_transform_radius(field, axis, gdata, cdata)
abstract backward_transform_radius_Nmax0(field, axis, cdata, gdata)
backward_transform_radius(field, axis, cdata, gdata)
conversion_matrix(m, spintotal, dk)
operator_matrix(op, m, spin, size=None)
interpolation(m, spintotal, position)
radius_multiplication_matrix(m, spintotal, order, d)
class SphereBasis(coordsystem, shape, dtype, radius=1, dealias=(1, 1), colatitude_library=None, azimuth_library=None)

Abstract base class for spectral bases.

dim = 2
dims = ['azimuth', 'colatitude']
subaxis_dependence = [True, True]
transforms
constant_mode_value
latitude_basis()
matrix_dependence(matrix_coupling)
global_shape(grid_space, scales)
chunk_shape(grid_space)
elements_to_groups(grid_space, elements)
m_maps()

Tuple of (m, mg_slice, mc_slice, ell_slice) for all local m’s when the colatitude axis is local.

ell_reversed()
ell_maps()

Tuple of (ell, m_slice, ell_slice) for all local ells in coeff space. m_slice and ell_slice are local slices along the phi and theta axes.

Data for each ell should be sliced as:

for ell, m_slice, ell_slice in ell_maps:

ell_data = data[m_slice, ell_slice]

global_grids(scales=None)

Global grids.

global_grid_colatitude(scale)
global_grid_spacing(axis, scales=None)

Global grids spacings.

local_grid_spacing(axis, scales=None)

Local grids spacings.

local_grids(scales=None)

Local grids.

local_grid_colatitude(scale)
global_colatitude_weights(scale=None)
local_colatitude_weights(scale=None)
transform_plan(Ntheta, s)

Build transform plan.

forward_transform_azimuth_Mmax0(field, axis, gdata, cdata)
forward_transform_azimuth(field, axis, gdata, cdata)
forward_transform_radius(field, axis, gdata, cdata)
backward_transform_azimuth_Mmax0(field, axis, cdata, gdata)
backward_transform_azimuth(field, axis, cdata, gdata)
backward_transform_radius(field, axis, cdata, gdata)
forward_transform_colatitude_Lmax0(field, axis, gdata, cdata)
forward_transform_colatitude(field, axis, gdata, cdata)
backward_transform_colatitude_Lmax0(field, axis, cdata, gdata)
backward_transform_colatitude(field, axis, cdata, gdata)
static k(l, s, mu)
k_vector(mu, m, s, local_l)
valid_elements(tensorsig, grid_space, elements)
ell_size(m)
operator_matrix(op, m, spintotal, size=None)
sine_multiplication_matrix(m, spintotal, order, size=None)
class ShellBasis(coordsystem, shape, dtype, radii=(1, 2), alpha=(- 0.5, - 0.5), dealias=(1, 1, 1), k=0, azimuth_library=None, colatitude_library=None, radius_library=None)

Abstract base class for spectral bases.

property meridional_basis
forward_transform_radius(field, axis, gdata, cdata)
backward_transform_radius(field, axis, cdata, gdata)
build_ncc_matrix(product, subproblem, ncc_cutoff, max_ncc_terms)
build_meridional_ncc_matrix(product, subproblem, ncc_cutoff, max_ncc_terms)
class BallBasis(coordsystem, shape, dtype, radius=1, k=0, alpha=0, dealias=(1, 1, 1), azimuth_library=None, colatitude_library=None, radius_library=None)

Abstract base class for spectral bases.

transforms
transform_plan(grid_shape, regindex, axis, regtotal, k, alpha)

Build transform plan.

forward_transform_radius(field, axis, gdata, cdata)
backward_transform_radius(field, axis, cdata, gdata)