Sailfish
Sailfish is a GPU-accelerated astrophysical gasdynamics code.
The main repository is hosted here: github.com/clemson-cal.
Quick-start
Basic use from the command line is like this: bin/sailfish shocktube
--end-time=0.2 --resolution=1000
. This command will run a built-in setup
called shocktube to a simulation time of 0.2 seconds, on a 1d grid with
1000 zones. The command line tool will print messages to the terminal, and
write a file called chkpt.final.pk to the disk in the current working
directory when the simulation finishes. This file is a Python pickle,
containing the simulation state and hydrodynamics solution data, and you can
load it in Python to plot the data.
Sailfish can also be used as a Python module from a custom script, as in the code below:
from sailfish.driver import run
from matplotlib import pyplot as plt
state = run("shocktube", end_time=0.2, resolution=1000)
rho = state.solver.primitive[:, 0]
plt.plot(rho)
plt.show()
The run function takes a sequence of arguments to control the driver and
problem setup, and then returns the simulation final state. However no
side-effects are performed by run and the terminal output is suppressed (you
can re-enable it with the keyword argument quiet=False
).
API documentation
Library functions and command-line access to the simulation driver. |
|
A Python module to facilitate JIT-compiled CPU-GPU agnostic compute kernels. |
|
Contains classes for different mesh geometries and dimensionalities. |
|
Physics support modules, other than hydro solvers. |
|
The Setup class dictates physics and solver choices to the driver. |
|
The Solver class maintains physics state and implements a solution scheme. |
|
Physics solvers and solution schemes. |
|
Utility functions for domain decomposition. |