dedalus.core.problems
¶
Classes for representing systems of equations.
Module Contents¶
-
logger
¶
-
class
Namespace
¶ Bases:
collections.OrderedDict
Class ensuring a conflict-free namespace for parsing.
-
copy
(self)¶ Copy entire namespace.
-
add_substitutions
(self, substitutions)¶ Parse substitutions in current namespace before adding to self.
-
-
class
ProblemBase
(domain, variables, ncc_cutoff=1e-10, max_ncc_terms=None, entry_cutoff=0)¶ 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-10)
- max_ncc_terms (int, optional) – Maximum terms to include in LHS NCC expansions (default: None (no limit))
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.
-
add_equation
(self, equation, condition='True')¶ Add equation to problem.
-
add_bc
(self, equation, condition='True')¶ Add boundary condition to problem.
-
namespace
(self)¶ Build namespace for problem parsing.
-
build_solver
(self, *args, **kw)¶ Build corresponding solver class.
-
class
InitialValueProblem
(domain, variables, time='t', **kw)¶ Bases:
dedalus.core.problems.ProblemBase
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
(self)¶ Build namespace for problem parsing.
-
class
LinearBoundaryValueProblem
¶ Bases:
dedalus.core.problems.ProblemBase
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
(self)¶
-
class
NonlinearBoundaryValueProblem
¶ Bases:
dedalus.core.problems.ProblemBase
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
(self)¶ Build namespace for problem parsing.
-
class
EigenvalueProblem
(domain, variables, eigenvalue, tolerance=1e-10, **kw)¶ Bases:
dedalus.core.problems.ProblemBase
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
(self)¶ Build namespace for problem parsing.
-
IVP
¶
-
LBVP
¶
-
NLBVP
¶
-
EVP
¶