dedalus.core.problems

Classes for representing systems of equations.

Module Contents

BC_TOP
INTERLEAVE_SUBBASES
STORE_EXPANDED_MATRICES
logger
class Namespace

Class ensuring a conflict-free namespace for parsing.

Initialize self. See help(type(self)) for accurate signature.

copy()

Copy entire namespace.

add_substitutions(substitutions)

Parse substitutions in current namespace before adding to self.

class ProblemBase(domain, variables, ncc_cutoff=1e-06, max_ncc_terms=None, entry_cutoff=1e-12)

Base class for problems consisting of a system of PDEs, constraints, and boundary conditions.

Parameters
  • domain (domain object) – Problem domain

  • variables (list of str) – List of variable names, e.g. [‘u’, ‘v’, ‘w’]

  • ncc_cutoff (float, optional) – Mode amplitude cutoff for LHS NCC expansions (default: 1e-6)

  • max_ncc_terms (int, optional) – Maximum terms to include in LHS NCC expansions (default: None (no limit))

  • entry_cutoff (float, optional) – Matrix entry cutoff to avoid fill-in from cancellation errors (default: 1e-12)

Variables
  • parameters (OrderedDict) – External parameters used in the equations, and held constant during integration.

  • substitutions (OrderedDict) – String-substitutions to be used in parsing.

Notes

Equations are entered as strings of the form “LHS = RHS”, where the left-hand side contains terms that are linear in the dependent variables (and will be parsed into a sparse matrix system), and the right-hand side contains terms that are non-linear (and will be parsed into operator trees).

The specified axes (from domain), variables, parameters, and substitutions are recognized by the parser, along with the built-in operators, which include spatial derivatives (of the form “dx()” for an axis named “x”) and basic mathematical operators (trigonometric and logarithmic).

The LHS terms must be linear in the specified variables and first-order in coupled derivatives.

property nvars_const
property nvars_nonconst
add_equation(equation, condition='True', tau=None)

Add equation to problem.

add_bc(*args, **kw)

Add boundary condition to problem.

namespace()

Build namespace for problem parsing.

build_solver(*args, **kw)

Build corresponding solver class.

class InitialValueProblem(domain, variables, time='t', **kw)

Class for non-linear initial value problems.

Parameters
  • domain (domain object) – Problem domain

  • variables (list of str) – List of variable names, e.g. [‘u’, ‘v’, ‘w’]

  • time (str, optional) – Time label, default: ‘t’

Notes

This class supports non-linear initial value problems. The LHS terms must be linear in the specified variables, first-order in coupled derivatives, first-order in time derivatives, and contain no explicit time dependence.

M.dt(X) + L.X = F(X, t)

solver_class
namespace_additions()

Build namespace for problem parsing.

class LinearBoundaryValueProblem(domain, variables, ncc_cutoff=1e-06, max_ncc_terms=None, entry_cutoff=1e-12)

Class for inhomogeneous, linear boundary value problems.

Parameters
  • domain (domain object) – Problem domain

  • variables (list of str) – List of variable names, e.g. [‘u’, ‘v’, ‘w’]

Notes

This class supports inhomogeneous, linear boundary value problems. The LHS terms must be linear in the specified variables and first-order in coupled derivatives, and the RHS must be independent of the specified variables.

L.X = F

solver_class
namespace_additions()
class NonlinearBoundaryValueProblem(domain, variables, ncc_cutoff=1e-06, max_ncc_terms=None, entry_cutoff=1e-12)

Class for nonlinear boundary value problems.

Parameters
  • domain (domain object) – Problem domain

  • variables (list of str) – List of variable names, e.g. [‘u’, ‘v’, ‘w’]

Notes

This class supports nonlinear boundary value problems. The LHS terms must be linear in the specified variables and first-order in coupled derivatives.

L.X = F(X)

The problem is reduced into a linear BVP for an update to the solution using the Newton-Kantorovich method and symbolically-computed Frechet derivatives of the RHS.

L.(X0 + X1) = F(X0) + dF(X0).X1 L.X1 - dF(X0).X1 = F(X0) - L.X0

solver_class
namespace_additions()

Build namespace for problem parsing.

class EigenvalueProblem(domain, variables, eigenvalue, tolerance=1e-10, **kw)

Class for linear eigenvalue problems.

Parameters
  • domain (domain object) – Problem domain

  • variables (list of str) – List of variable names, e.g. [‘u’, ‘v’, ‘w’]

  • eigenvalue (str) – Eigenvalue label, e.g. ‘sigma’ WARNING: ‘lambda’ is a python reserved word. You cannot use it as your eigenvalue. Also, note that unicode symbols don’t work on all machines.

  • tolerance (float) – A floating point number (>= 0) which helps ‘define’ zero for the RHS of the equation. If the RHS has nonzero NCCs which add to zero, dedalus will check to make sure that the max of the expression on the RHS normalized by the max of all NCCs going in that expression is smaller than this tolerance (see ProblemBase._check_if_zero() )

Notes

This class supports linear eigenvalue problems. The LHS terms must be linear in the specified variables, first-order in coupled derivatives, and linear or independent of the specified eigenvalue. The RHS must be zero.

σM.X + L.X = 0

solver_class
namespace_additions()

Build namespace for problem parsing.

IVP
LBVP
NLBVP
EVP