simpok
High level Python API for phase field simulation of phase-ordering kinetics, with all computationally intensive operations, including GPU-accelerated kernels, implemented in Mojo programming langauge.
Implemented Systems: Dimensionless CHC, TDGL, and SDSD solvers
Install
pip install simpok
The models
TDGL — nonconserved scalar order parameter (Model A).
∂ψ/∂t = ψ − ψ³ + h + ∇²ψ + θ
CHC — conserved scalar order parameter (Model B).
∂ψ/∂t = −∇²(ψ − ψ³ + ∇²ψ) + ∇·θ
SDSD — surface-directed spinodal decomposition. The same conserved dynamics in contact with
a wall at z = 0 that prefers one component: the bulk phase separates while the wall is wetted.
∂ψ/∂t = −∇²(ψ − ψ³ + ½∇²ψ − V(z)) + ∇·θ z > 0
h₁ + gψ + γ ∂ψ/∂z = 0 at z = 0
∂/∂z(−ψ + ψ³ − ½∇²ψ + V) = 0 at z = 0
with the long-ranged wall potential V(z) = −V₀/zⁿ (cut off at −V₀ for z ≤ 1).
API
TDGL(ny=256, nx=256, dx=1.0, dt=0.1, h=0.0, eps=0.0, dtype=np.float64, device="auto")
CHC (ny=256, nx=256, dx=1.0, dt=0.01, eps=0.0, dtype=np.float64, device="auto")
SDSD(nz=256, nx=256, dx=1.0, dt=0.03, h1=0.8, g=-0.4, gamma=0.4, v0=None, n=4,
potential=None, eps=0.0, dtype=np.float64, device="auto")
The wall potential of SDSD defaults to the power law above, shaped by v0 and n. Any other
shape can be passed to potential as a callable of z or as one value per row:
SDSD(potential=lambda z: -0.8 * np.exp(-z / 3.0)) # short-ranged well
SDSD(potential=lambda z: np.where(z <= 5.0, -0.8, 0.0)) # square well
SDSD(potential=np.zeros(256)) # no potential at all
Examples
Runnable scripts for all three solvers are in examples/.
Hardware notes
- Supported Device — GPU (AMD, NVIDIA, APPLE) and CPU
License
MIT — see LICENSE.
Metadata
Release files for simpok 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simpok-1.0.0.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simpok-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.2 kB
Release files / simpok-1.0.0.tar.gz
| Download URL | simpok-1.0.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87f7ca3b6714180c8595c3f94e28f794c35744ea23dde1b05b1ce6fdb23e05f5
|
|
BLAKE2b-256 checksum How to use checksums |
f637c513f2f740530816e0710e0a70b9f9e8ed89c61a3f61af3d5cb1c39118af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / simpok-1.0.0-py3-none-any.whl
| Download URL | simpok-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d85e43a9f6d829f1a7b17a5a4882f6e08b59de075dbda214145f86828671e580
|
|
BLAKE2b-256 checksum How to use checksums |
fdcde25243ba743958c95de648d18e16a340af37bd2ce388f65511b37376a7e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|