evoxels.problem_definition
Classes
|
|
|
|
|
|
|
|
|
|
|
|
- class evoxels.problem_definition.AllenCahnEquation(vg: evoxels.voxelgrid.VoxelGrid, eps: float = 2.0, gab: float = 1.0, M: float = 1.0, force: float = 0.0, curvature: float = 0.01, potential: Callable | None = None)
- M: float = 1.0
- __init__(vg: VoxelGrid, eps: float = 2.0, gab: float = 1.0, M: float = 1.0, force: float = 0.0, curvature: float = 0.01, potential: Callable | None = None) None
- property bc_type
E.g. ‘periodic’, ‘dirichlet’, or ‘neumann’.
- curvature: float = 0.01
- eps: float = 2.0
- force: float = 0.0
- property fourier_symbol
Symbol of the highest order spatial operator
The symbol of an operator is its representation in the Fourier (spectral) domain. For instance the: - Laplacian operator $
- abla^2$ has a symbol $-k^2$,
diffusion operator $D
abla^2$ corresponds to $-k^2D$
The symbol is required for pseudo-spectral timesteppers.
- gab: float = 1.0
- property order
Spatial order of convergence for numerical right-hand side.
- pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- potential: Callable | None = None
- rhs(t, phi)
Two-phase Allen-Cahn equation
Microstructural evolution of the order parameter
\phiwhich can be interpreted as a phase fraction. \(M\) denotes the mobility, \(\epsilon\) controls the diffuse interface width, \(\gamma\) denotes the interfacial energy. The laplacian leads to a phase evolution driven by curvature minimization which can be controlled by settingcurvature=in range \([0,1]\).- Parameters:
phi (array-like) – order parameter.
t (float) – Current time.
- Returns:
Backend array of the same shape as
\phicontainingd\phi/dt.
- rhs_analytic(t, phi)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.CoupledReactionDiffusion(vg: evoxels.voxelgrid.VoxelGrid, D_A: float = 1.0, D_B: float = 0.5, feed: float = 0.055, kill: float = 0.117, interaction: Callable | None = None)
- D_A: float = 1.0
- D_B: float = 0.5
- __init__(vg: VoxelGrid, D_A: float = 1.0, D_B: float = 0.5, feed: float = 0.055, kill: float = 0.117, interaction: Callable | None = None) None
- property bc_type
E.g. ‘periodic’, ‘dirichlet’, or ‘neumann’.
- feed: float = 0.055
- property fourier_symbol
Symbol of the highest order spatial operator
The symbol of an operator is its representation in the Fourier (spectral) domain. For instance the: - Laplacian operator $
- abla^2$ has a symbol $-k^2$,
diffusion operator $D
abla^2$ corresponds to $-k^2D$
The symbol is required for pseudo-spectral timesteppers.
- interaction: Callable | None = None
- kill: float = 0.117
- property order
Spatial order of convergence for numerical right-hand side.
- pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- rhs(t, u)
Two-component reaction-diffusion system
Use batch channels for multiple species: - Species A with concentration c_A = u[0] - Species B with concentration c_B = u[1]
- Parameters:
u (array-like) – species
t (float) – Current time.
- Returns:
Backend array of the same shape as
ucontainingdu/dt.
- rhs_analytic(t, u)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.ODE
- abstract property bc_type: str
E.g. ‘periodic’, ‘dirichlet’, or ‘neumann’.
- abstract property order: int
Spatial order of convergence for numerical right-hand side.
- abstractmethod pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- abstractmethod rhs(t, u)
Numerical right-hand side of the ODE system.
- Parameters:
t (float) – Current time.
u (array) – Current state.
- Returns:
Same type as
ucontaining the time derivative.
- abstractmethod rhs_analytic(t, u)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.PeriodicCahnHilliard(vg: evoxels.voxelgrid.VoxelGrid, eps: float = 3.0, D: float = 1.0, mu_hom: Callable | None = None, A: float = 0.25)
- A: float = 0.25
- D: float = 1.0
- __init__(vg: VoxelGrid, eps: float = 3.0, D: float = 1.0, mu_hom: Callable | None = None, A: float = 0.25) None
- property bc_type
E.g. ‘periodic’, ‘dirichlet’, or ‘neumann’.
- eps: float = 3.0
- property fourier_symbol
Symbol of the highest order spatial operator
The symbol of an operator is its representation in the Fourier (spectral) domain. For instance the: - Laplacian operator $
- abla^2$ has a symbol $-k^2$,
diffusion operator $D
abla^2$ corresponds to $-k^2D$
The symbol is required for pseudo-spectral timesteppers.
- mu_hom: Callable | None = None
- property order
Spatial order of convergence for numerical right-hand side.
- pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- rhs(t, c)
Evaluate \(\partial c / \partial t\) for the CH equation.
Numerical computation of
\[\frac{\partial c}{\partial t} = \nabla \cdot \bigl( M \, \nabla \mu \bigr), \quad \mu = \frac{\delta F}{\delta c} = f'(c) - \kappa \, \nabla^2 c\]where \(M\) is the (possibly concentration-dependent) mobility, \(\mu\) the chemical potential, and \(\kappa\) the gradient energy coefficient.
- Parameters:
c (array-like) – Concentration field.
t (float) – Current time.
- Returns:
Backend array of the same shape as
ccontainingdc/dt.
- rhs_analytic(t, c)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.ReactionDiffusion(vg: evoxels.voxelgrid.VoxelGrid, D: float, BC_type: str, bcs: tuple = (0, 0), f: Callable | None = None, A: float = 0.25)
- A: float = 0.25
- BC_type: str
- D: float
- __init__(vg: VoxelGrid, D: float, BC_type: str, bcs: tuple = (0, 0), f: Callable | None = None, A: float = 0.25) None
- property bc_type
E.g. ‘periodic’, ‘dirichlet’, or ‘neumann’.
- bcs: tuple = (0, 0)
- f: Callable | None = None
- property fourier_symbol
Symbol of the highest order spatial operator
The symbol of an operator is its representation in the Fourier (spectral) domain. For instance the: - Laplacian operator $
- abla^2$ has a symbol $-k^2$,
diffusion operator $D
abla^2$ corresponds to $-k^2D$
The symbol is required for pseudo-spectral timesteppers.
- property order
Spatial order of convergence for numerical right-hand side.
- pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- rhs(t, u)
Numerical right-hand side of the ODE system.
- Parameters:
t (float) – Current time.
u (array) – Current state.
- Returns:
Same type as
ucontaining the time derivative.
- rhs_analytic(t, u)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.ReactionDiffusionSBM(vg: evoxels.voxelgrid.VoxelGrid, D: float, BC_type: str, bcs: tuple = (0, 0), f: Callable | None = None, A: float = 0.25, mask: Any | None = None, bc_flux: Callable | float = 0.0)
- __init__(vg: VoxelGrid, D: float, BC_type: str, bcs: tuple = (0, 0), f: Callable | None = None, A: float = 0.25, mask: Any | None = None, bc_flux: Callable | float = 0.0) None
- bc_flux: Callable | float = 0.0
- mask: Any | None = None
- pad_bc(u)
Function to pad and impose boundary conditions.
Enables applying boundary conditions on u within and outside of the right-hand-side function.
- Parameters:
u – field
- Returns:
Field padded with boundary values.
- rhs(t, u)
Numerical right-hand side of the ODE system.
- Parameters:
t (float) – Current time.
u (array) – Current state.
- Returns:
Same type as
ucontaining the time derivative.
- rhs_analytic(t, u, mask)
Sympy expression of the problem right-hand side.
- Parameters:
t (float) – Current time.
u – Sympy function of current state.
- Returns:
Sympy function of problem right-hand side.
- class evoxels.problem_definition.SemiLinearODE
- abstract property fourier_symbol
Symbol of the highest order spatial operator
The symbol of an operator is its representation in the Fourier (spectral) domain. For instance the: - Laplacian operator $
- abla^2$ has a symbol $-k^2$,
diffusion operator $D
abla^2$ corresponds to $-k^2D$
The symbol is required for pseudo-spectral timesteppers.