Bounded-domain steppers¶
These steppers use cell-centred grids. See the bounded noise conventions.
Diffusion¶
Exact heat drift and an exact Gaussian increment.
import exponax_spde as spde
step = spde.bounded.StochasticDiffusion(1, 1.0, 32, 0.01, boundary="neumann")
Validated by automated tests and the notebook.
exponax_spde.bounded.StochasticDiffusion ¶
Isotropic bounded heat flow with additive OU forcing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_spatial_dims
|
int
|
Number of spatial dimensions. |
required |
domain_extent
|
float
|
Side length of the domain on every axis. |
required |
num_points
|
int
|
Number of grid points per spatial axis. |
required |
dt
|
float
|
Time between consecutive states. |
required |
boundary
|
Boundary
|
Neumann or Dirichlet boundary conditions on the cell-centred grid. |
'neumann'
|
diffusivity
|
float
|
Diffusion coefficient. |
0.01
|
sigma
|
float
|
Physical noise intensity. |
0.1
|
noise_alpha
|
float
|
Matérn exponent when no explicit spectrum is supplied. |
1.0
|
noise_spectrum
|
Spectrum | None
|
Explicit spectrum. Leave the Matérn exponent at its default when supplied. |
None
|
noise_basis
|
NoiseBasis
|
Orthonormal forcing or forcing in the unnormalised sine/cosine basis. |
'orthonormal'
|
mean_noise
|
bool
|
Whether to force the constant mode when it exists. |
True
|
order
|
int
|
Order of the exponential integrator for the drift. |
0
|
num_circle_points
|
int
|
Number of quadrature points for the ETDRK contour integral. |
16
|
circle_radius
|
float
|
Radius of the ETDRK contour integral. |
1.0
|
Allen–Cahn¶
Double-well reaction on a cell-centred grid with additive forcing.
import exponax_spde as spde
step = spde.bounded.StochasticAllenCahn(
1, 1.0, 64, 0.001, sigma=0.05, boundary="neumann"
)
Validated by automated tests and the notebook.
exponax_spde.bounded.StochasticAllenCahn ¶
Bounded Allen–Cahn with untamed ETDRK drift and additive OU forcing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_spatial_dims
|
int
|
Number of spatial dimensions. |
required |
domain_extent
|
float
|
Side length of the domain on every axis. |
required |
num_points
|
int
|
Number of grid points per spatial axis. |
required |
dt
|
float
|
Time between consecutive states. |
required |
boundary
|
Boundary
|
Neumann or Dirichlet boundary conditions on the cell-centred grid. |
'neumann'
|
diffusivity
|
float
|
Diffusion coefficient. |
0.01
|
lambda_
|
float
|
Reaction coefficient of \(u-u^3\). |
1.0
|
sigma
|
float
|
Physical noise intensity. |
0.1
|
noise_alpha
|
float
|
Matérn exponent when no explicit spectrum is supplied. |
1.0
|
noise_spectrum
|
Spectrum | None
|
Explicit spectrum. Leave the Matérn exponent at its default when supplied. |
None
|
noise_basis
|
NoiseBasis
|
Orthonormal forcing or forcing in the unnormalised sine/cosine basis. |
'orthonormal'
|
mean_noise
|
bool
|
Whether to force the constant mode when it exists. |
True
|
dealiasing_fraction
|
float
|
Fraction of spatial modes retained for the nonlinear evaluation. |
0.5
|
order
|
int
|
Order of the exponential integrator for the drift. |
1
|
num_circle_points
|
int
|
Number of quadrature points for the ETDRK contour integral. |
16
|
circle_radius
|
float
|
Radius of the ETDRK contour integral. |
1.0
|
Cahn–Hilliard¶
Additive, mean-unforced dynamics. Neumann boundaries conserve mass.
import exponax_spde as spde
step = spde.bounded.StochasticCahnHilliard(2, 1.0, 32, 0.0001, boundary="neumann")
Validated by automated tests and the notebook.
exponax_spde.bounded.StochasticCahnHilliard ¶
Bounded Cahn–Hilliard, with unforced DC and Cook noise by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_spatial_dims
|
int
|
Number of spatial dimensions. |
required |
domain_extent
|
float
|
Side length of the domain on every axis. |
required |
num_points
|
int
|
Number of grid points per spatial axis. |
required |
dt
|
float
|
Time between consecutive states. |
required |
boundary
|
Boundary
|
Neumann or Dirichlet boundary conditions on the cell-centred grid. |
'neumann'
|
diffusivity
|
float
|
Diffusion coefficient. |
0.01
|
gamma
|
float
|
Coefficient of the squared Laplacian relative to the diffusivity. |
0.001
|
first_order_coefficient
|
float
|
Linear coefficient in the chemical potential. |
-1.0
|
third_order_coefficient
|
float
|
Cubic coefficient in the chemical potential. |
1.0
|
sigma
|
float
|
Physical noise intensity. |
0.1
|
noise_alpha
|
float
|
Matérn exponent when no explicit spectrum is supplied. |
1.0
|
noise_spectrum
|
Spectrum | None
|
Explicit spectrum. Leave the Matérn exponent at its default when supplied. |
None
|
noise_basis
|
NoiseBasis
|
Orthonormal forcing or forcing in the unnormalised sine/cosine basis. |
'orthonormal'
|
dealiasing_fraction
|
float
|
Fraction of spatial modes retained for the nonlinear evaluation. |
0.5
|
order
|
int
|
Order of the exponential integrator for the drift. |
1
|
num_circle_points
|
int
|
Number of quadrature points for the ETDRK contour integral. |
16
|
circle_radius
|
float
|
Radius of the ETDRK contour integral. |
1.0
|
Swift–Hohenberg¶
Pattern formation with a polynomial reaction and a preferred wavenumber.
import exponax_spde as spde
step = spde.bounded.StochasticSwiftHohenberg(
2, 12.56, 32, 0.01, reactivity=0.3, boundary="neumann"
)
Validated by automated tests and the notebook.
exponax_spde.bounded.StochasticSwiftHohenberg ¶
Bounded Swift–Hohenberg with an odd reaction under Dirichlet data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_spatial_dims
|
int
|
Number of spatial dimensions. |
required |
domain_extent
|
float
|
Side length of the domain on every axis. |
required |
num_points
|
int
|
Number of grid points per spatial axis. |
required |
dt
|
float
|
Time between consecutive states. |
required |
boundary
|
Boundary
|
Neumann or Dirichlet boundary conditions on the cell-centred grid. |
'neumann'
|
reactivity
|
float
|
Linear growth rate. |
0.7
|
critical_number
|
float
|
The constant added to the Laplacian before squaring. |
1.0
|
polynomial_coefficients
|
tuple[float, ...]
|
Coefficients in ascending order of power. |
(0.0, 0.0, 1.0, -1.0)
|
sigma
|
float
|
Physical noise intensity. |
0.1
|
noise_alpha
|
float
|
Matérn exponent when no explicit spectrum is supplied. |
1.0
|
noise_spectrum
|
Spectrum | None
|
Explicit spectrum. Leave the Matérn exponent at its default when supplied. |
None
|
noise_basis
|
NoiseBasis
|
Orthonormal forcing or forcing in the unnormalised sine/cosine basis. |
'orthonormal'
|
mean_noise
|
bool
|
Whether to force the constant mode when it exists. |
True
|
dealiasing_fraction
|
float
|
Fraction of spatial modes retained for the nonlinear evaluation. |
0.5
|
order
|
int
|
Order of the exponential integrator for the drift. |
1
|
num_circle_points
|
int
|
Number of quadrature points for the ETDRK contour integral. |
16
|
circle_radius
|
float
|
Radius of the ETDRK contour integral. |
1.0
|
Basis transforms¶
exponax_spde.bounded.to_coefficients ¶
to_coefficients(u: Array, boundary: Boundary) -> Array
Transform a field with an orthonormal DCT-II or DST-II.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Array
|
Channel-first field on the cell-centred grid. |
required |
boundary
|
Boundary
|
Neumann for cosine or Dirichlet for sine coefficients. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Channel-first real coefficients of the same shape. |
exponax_spde.bounded.to_physical ¶
to_physical(
coefficients: Array, boundary: Boundary
) -> Array
Invert the orthonormal bounded-domain transform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coefficients
|
Array
|
Channel-first real coefficients. |
required |
boundary
|
Boundary
|
Neumann for cosine or Dirichlet for sine coefficients. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Real field on the cell-centred grid. |
Types¶
exponax_spde.bounded.NoiseBasis
module-attribute
¶
NoiseBasis = Literal['orthonormal', 'unnormalised']