dedalus.core.operators

Abstract and built-in classes defining deferred operations on fields.

Module Contents

class AdvectiveCFL(operand, coords)

Calculates the scalar advective grid-crossing frequency associated with a given velocity vector.

Parameters:
  • operand (number or Operand object)

  • space (Space object)

check_conditions()

Check that operands are in full grid space.

abstractmethod compute_cfl_frequency(velocity, out)

Return a scalar multi-D field of the cfl frequency everywhere in the domain.

enforce_conditions()

Require operands to be in full grid space.

new_operand(operand, **kw)
operate(out)

Perform operation.

coords
domain
dtype
input_basis
name = 'cfl'
operand
tensorsig = ()
class AngularComponent(operand, index=0, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Angular'
class Average(operand, coord)

Average over operand bases.

Parameters:
  • operand (number or Operand object)

  • coords (Coordinate or CoordinateSystem object, or list of these)

coord
domain
dtype
first_axis
input_basis
last_axis
name = 'Average'
operand
output_basis
tensorsig
class AzimuthalComponent(operand, index=0, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Azimuthal'
tensorsig
class Component(operand, index=0, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

check_conditions()

Can always take components

enforce_conditions()

Can always take components

matrix_coupling(*vars)
matrix_dependence(*vars)
coordsys
domain
dtype
index = 0
input_basis
name = 'Component'
operand
tensorsig
class Convert(operand, output_basis, out=None)

Convert an operand between two bases, assuming coupling over just the last axis of the bases.

Parameters:
  • operand (Operand object)

  • output_basis (Basis object)

check_conditions()

Check that arguments are in a proper layout.

enforce_conditions()

Require arguments to be in a proper layout.

new_operand(operand, **kw)
operate(out)

Perform operation.

replace(old, new)

Replace specified operand/operator.

replace_dict(subs)

Replace specified operands/operators according to a dictionary.

subspace_matrix(layout)

Build matrix operating on global subspace data.

coords
domain
dtype
first_axis
input_basis
last_axis
name = 'Convert'
operand
output_basis
tensorsig
class Curl(*args, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Curl'
class Differentiate(operand, coord, out=None)

Differentiation along one dimension.

Parameters:
  • operand (number or Operand object)

  • space (Space object)

new_operand(operand, **kw)
axis
coord
domain
dtype
first_axis
input_basis
last_axis
name = 'Diff'
operand
output_basis
tensorsig
class Divergence(*args, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Div'
class GeneralFunction(dist, domain, tensorsig, dtype, layout, func, args=[], kw={}, out=None)

Operator wrapping a general python function to return a field.

Parameters:
  • dist (distributor object) – Distributor

  • domain (domain object) – Domain

  • tensorsig (tuple of coordinate systems) – Tensor signature of output field (corresponding to, e.g., scalar, vector, rank-2 tensor, etc.)

  • dtype (dtype) – Data type of output field

  • layout (layout object or identifier) – Layout of output field

  • func (function) – Function producing field data

  • args (list) – Arguments to pass to func

  • kw (dict) – Keywords to pass to func

  • out (field, optional) – Output field (default: new field)

Notes

On evaluation, this wrapper evaluates the provided function with the given arguments and keywords, and takes the output to be data in the specified layout, i.e.

out[layout] = func(*args, **kw)

check_conditions()

Check that arguments are in a proper layout.

enforce_conditions()

Require arguments to be in a proper layout.

operate(out)

Perform operation.

args = []
dist
domain
dtype
func
kw
last_id = None
layout
original_args = []
out = None
tensorsig
class Gradient(*args, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Grad'
class Integrate(operand, coord)

Integrate over operand bases.

Parameters:
  • operand (number or Operand object)

  • coords (Coordinate or CoordinateSystem object, or list of these)

new_operand(operand, **kw)
coord
domain
dtype
first_axis
input_basis
last_axis
name = 'Integrate'
operand
output_basis
tensorsig
class Interpolate(operand, coord, position, out=None)

Interpolation along one dimension.

Parameters:
  • operand (number or Operand object)

  • space (Space object)

  • position (‘left’, ‘center’, ‘right’, or float)

new_operand(operand, **kw)
subspace_matrix(layout)

Build matrix operating on global subspace data.

coord
domain
dtype
first_axis
input_basis
last_axis
name = 'interp'
operand
output_basis
position
tensorsig
class Laplacian(*args, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Lap'
class Lift(operand, output_basis, n, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
domain
dtype
first_axis
input_basis
last_axis
n
name = 'Lift'
operand
output_basis
tensorsig
class MulCosine(operand, coordsys=None, out=None)

Cosine multiplication for S2.

new_operand(operand, **kw)
radial_matrix(spinindex_in, spinindex_out, m)
spinindex_out(spinindex_in)
domain
dtype
name = 'MulCos'
tensorsig
class RadialComponent(operand, index=0, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'Radial'
tensorsig
class Skew(operand, index=0, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

check_conditions()

Can always take components

enforce_conditions()

Can always take components

matrix_coupling(*vars)
matrix_dependence(*vars)
new_operand(operand, **kw)
coordsys
domain
dtype
index = 0
name = 'Skew'
operand
tensorsig
class SphericalEllProduct(operand, coordsys)

Base class for linear operators acting on the coefficients of an individual spectral basis.

Subclasses must define the following attributes:

# SpectralOperator requirements self.coord self.input_basis self.output_basis self.first_axis self.last_axis self.subaxis_dependence self.subaxis_coupling

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

new_operand(operand, **kw)
name = 'SphericalEllProduct'
class TimeDerivative(operand, out=None)

Class for representing time derivative while parsing.

matrix_coupling(*vars)
matrix_dependence(*vars)
property base
domain
dtype
name = 'dt'
operand
tensorsig
class Trace(operand, out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

check_conditions()

Right now require grid space

enforce_conditions()

Require arguments to be in a proper layout.

matrix_coupling(*vars)
matrix_dependence(*vars)
new_operand(operand, **kw)
operate(out)

Perform operation.

property base
coordsys
domain
dtype
input_basis
name = 'Trace'
operand
tensorsig
class TransposeComponents(operand, indices=(0, 1), out=None)

Base class for linear operators.

Subclasses must define the following attributes:

# LinearOperator requirements self.operand

# FutureField requirements self.domain self.tensorsig self.dtype

check_conditions()

Can always take the transpose

enforce_conditions()

Can always take the transpose

matrix_coupling(*vars)
matrix_dependence(*vars)
new_operand(operand, **kw)
coordsys
domain
dtype
indices
input_basis
name = 'TransposeComponents'
new_axis_order
operand
tensorsig
class UnaryGridFunction(func, arg, deriv=None, out=None)

Wrapper for applying unary functions to fields in grid space. This can be used with arbitrary user-defined functions, but symbolic differentiation is only implemented for some scipy/numpy universal functions.

Parameters:
  • func (function) – Unary function acting on grid data. Must be vectorized and include an output array argument, e.g. func(x, out).

  • arg (dedalus operand) – Argument field or operator.

  • deriv (function, optional) – Symbolic derivative of func. Defaults are provided for some common numpy/scipy ufuncs (default: None).

  • out (field, optional) – Output field (default: new field).

Notes

The supplied function must support an output argument called ‘out’ and act in a vectorized fashion. The action is essentially:

func(arg[‘g’], out=out[‘g’])

check_conditions()

Check that arguments are in a proper layout.

enforce_conditions()

Require arguments to be in a proper layout.

new_operand(arg)
new_operands(arg)
operate(out)

Perform operation.

reinitialize(**kw)
sym_diff(var)

Symbolically differentiate with respect to specified operand.

domain
dtype
func
property name
tensorsig
ufunc_derivatives
Coeff(operand)
Grid(operand)
LiftTau(*args, **kw)