Skip to content

SELAHStage-wise Evolution Library for Accelerators and HPC

Time integrators as stage-wise operators for block-structured field solvers, on CPUs and GPUs, in modern Fortran. Every claim verified.

SELAH, one drop falling on still water and four rings spreading from itSELAH, one drop falling on still water and four rings spreading from it

See it run ​

Strong stability: SSP(5,4) at ν = C keeps the total variation from growing; above its threshold it does not. P1
Symplecticity: the Strang splitting stays on a closed orbit, rk4 spirals in. P3

Time integrators ​

Every scheme the public API exports: pass the constant to stepper%initialize with one of its storage forms (registers in brackets). Schemes has the tableaux and their derivations.

Runge–KuttaNameStagesOrderSSP coefficientStorage formsSource
SCHEME_EULEReuler111Butcher (2), two-register (2)forward Euler
SCHEME_SSP_22ssp-22221Butcher (3), two-register (2)Shu & Osher (1988)
SCHEME_SSP_33ssp-33331Butcher (4), two-register (2)Shu & Osher (1988)
SCHEME_SSP_54ssp-54541.508180049Butcher (6)Spiteri & Ruuth (2002)
SCHEME_SSP_104ssp-1041046Butcher (11), Ketcheson (2)Ketcheson (2008)
SCHEME_RK4rk444—Butcher (5)Kutta (1901)
SCHEME_LSRK_33lsrk-3333—Butcher (4), Williamson 2N (2)Williamson (1980)
SCHEME_LSRK_54lsrk-5454—Butcher (6), Williamson 2N (2)Carpenter & Kennedy (1994)
SplittingNameFlowsOrderStorage formSource
SCHEME_STRANGstrang32splitting (1)Strang (1968)
SCHEME_YOSHIDA_4yoshida-474splitting (1)Yoshida (1990)
SCHEME_BLANES_MOAN_S6blanes-moan-s6134splitting (1)Blanes & Moan (2002), S6
SCHEME_BLANES_MOAN_S10blanes-moan-s10216splitting (1)Blanes & Moan (2002), S10
SCHEME_LIElie21additive splitting only (additive_splitting)Trotter (1959)

Quick start ​

Build the library and run the verification programs, or pull SELAH into your own project.

bash
git clone https://github.com/szaghi/SELAH && cd SELAH
fobis fetch                                                   # PENF, FUNDAL (and GIDEON, for the tests)
fobis build --mode static-gnu                                 # lib/gnu/static/libselah.a
fobis build --mode tests-gnu && bash scripts/run_tests.sh     # the verification programs
ini
# fobos of your project; then: fobis fetch && fobis build
[dependencies]
deps_dir = src/third_party
PENF     = https://github.com/szaghi/PENF :: branch=master    # SELAH's own dependencies: fobis fetch is not transitive
FUNDAL   = https://github.com/szaghi/FUNDAL :: branch=main
SELAH    = https://github.com/szaghi/SELAH :: branch=main
toml
# fpm.toml of your project
[dependencies]
SELAH = { git = "https://github.com/szaghi/SELAH", branch = "main" }

One step, driven stage by stage (the whole program):

fortran
use selah
type(stepper) :: st

call st%initialize(SCHEME_SSP_54, FORM_BUTCHER, lb=lbound(q), ub=ubound(q))
call st%begin_step(bx, q)
do k=1, st%stages()
   call st%begin_stage(k, bx, dt, q)
   u => st%stage_state() ; r => st%rhs_register()
   call fill_ghosts(u)            ! yours
   call residual(u, r)            ! yours
   call st%end_stage(k, bx, dt, q)
enddo
call st%finish_step(bx, dt, q)

Authors ​

Stefano Zaghi

Stefano Zaghi

Chief Yak Shaver & Keeper of the Time Step

Believes every problem is one more library away from being solved, and keeps proving it.

Claude

Claude

Tireless Rubber Duck & Professional Pedant @ Anthropic

AI pair programmer; checks the order conditions so humans don't have to, and has an opinion on every comma.

License ​

SELAH is available under your choice of license.

LicenseSPDXFile
GNU General Public License v3GPL-3.0-or-laterLICENSE.gpl3.md
BSD 2-ClauseBSD-2-ClauseLICENSE.bsd-2.md
BSD 3-ClauseBSD-3-ClauseLICENSE.bsd-3.md
MITMITLICENSE.mit.md

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice