Skip to content

v0.2.0

Latest

Choose a tag to compare

@Ceyron Ceyron released this 20 Feb 09:21
· 6 commits to main since this release

This release brings major new physics capabilities, numerical improvements, and a significantly expanded test suite and documentation. Moreover, an improved instantion of the steppers reduces peak memory consumption, allowing to scale to higher resolutions in higher dimensions, e.g., you can now simulate phenomena of 4096^2 and 256^3 on consumer-grade GPUs (with 24GB of memory) as well as >10000^2 and 512^3 on high-end GPUs (e.g., A100 with 80GB)... potentially with even higher resolutions on the most modern 200GB+ generations. Check out this new example on the 3D Kolmogorov Flow as a starting point.

Breaking Changes

IC Generator API and Output Changes (#97, #93)

  • RandomTruncatedFourierSeries: The amplitude_range and angle_range parameters have been removed. Code passing these arguments will raise an error.
  • GaussianRandomField and RandomTruncatedFourierSeries now generate white noise in physical space (instead of Fourier space) before applying spectral shaping. This produces numerically different initial conditions for the same random seed.

Nonlinear Stepper Output Changes (#96)

  • All nonlinear steppers (Burgers, KdV, KS, Navier-Stokes, etc.) now apply automatic post-dealiasing inside the fft()/ifft() methods of the nonlinear function base class. This produces numerically different trajectories compared to v0.1.1 (more accurate due to reduced aliasing artifacts).

make_incompressible Sign Fix (#90)

  • The sign in the Poisson pressure correction was fixed: Delta p = div(v) (previously had an incorrect negation). Results from exponax.make_incompressible() will differ from v0.1.1.

DiffultyLinearStepperSimple Renamed (#80)

  • Corrected typo: DiffultyLinearStepperSimple -> DifficultyLinearStepperSimple. The old name is kept as a deprecated alias that emits a warning — existing code will still work but should be updated.

New Features

Wave Equation Stepper (#74)

  • New exponax.stepper.Wave for solving the d-dimensional wave equation (u_tt = c^2 Delta u) on periodic domains in 1D, 2D, and 3D.
  • Uses a handcrafted change-of-basis diagonalization (rescaling + rotation) to decompose the second-order wave equation into two decoupled first-order modes (left- and right-traveling waves), enabling exact exponential time-stepping in Fourier space.
  • Unconditionally stable (no CFL restriction), energy-conservative, and parameterized by an arbitrary speed of sound.
  • Special handling of the DC mode (k=0) for correct mean-field drift.

3D Navier-Stokes Steppers (#75)

  • New NavierStokesVelocity stepper for 3D incompressible Navier-Stokes using the rotational (Lamb) form P(u x omega) with Leray projection for divergence-free enforcement.
  • New KolmogorovFlowVelocity stepper for 3D forced turbulence with sinusoidal body forcing
  • Supporting infrastructure: Leray projection operator, ProjectedConvection3d, and ProjectedConvection3dKolmogorov nonlinear functions.

Kolmogorov Flow Validation (#99)

  • Added validation notebooks for 2D and 3D Kolmogorov flow with spectral analysis, confirming correct turbulent energy cascade behavior and parameter sensitivity.

Numerical Improvements

Post-Dealiasing via fft/ifft Wrapping (#96)

  • Dealiasing is now centralized in the BaseNonlinearFun base class through wrapped fft() and ifft() methods that automatically apply low-pass filtering (Orszag's 2/3 rule by default).
  • Pre-dealiasing (in ifft) cleans inputs before nonlinear evaluation; post-dealiasing (in fft) removes aliasing artifacts created by nonlinear products.
  • All concrete nonlinear functions are simplified — they no longer need manual dealiasing calls.

Scan-Based ETDRK Coefficient Computation (#91)

  • ETDRK coefficient calculations (ETDRK1–4) now use jax.lax.scan instead of materializing large temporary arrays, significantly reducing peak memory usage for high num_circle_points values.

Bug Fixes

Nyquist Artifact in Fourier-Space IC Generators (#97)

  • Fixed a spurious energy spike at the Nyquist mode for even resolutions in 2D/3D. IC generators (GaussianRandomField, RandomTruncatedFourierSeries) now generate white noise in physical space first and then transform to Fourier space, eliminating the artifact.
  • Introduced a WhiteNoise base class and shared normalization utilities.

Scaling Mode in IC Generators (#93)

  • Fixed GaussianRandomField and RandomTruncatedFourierSeries using incorrect mode="coef_extraction" instead of mode="reconstruction" for the spectral scaling array.
  • Fixed an inverted validation condition in RandomTruncatedFourierSeries that rejected valid std_one configurations and allowed invalid ones.

Order-Zero Laplace Operator (#92)

  • build_laplace_operator() now correctly returns the identity operator when order=0, instead of raising an error or producing incorrect results.

Incompressibility Projection Sign Error (#90)

  • Fixed sign error in divergence computation for the pressure projection: Delta p = div(v) (was incorrectly negated).

Typo Fix: pseudo_pressure_gradient (#90)

  • Corrected misspelling pseudo_pressure_garadient -> pseudo_pressure_gradient.

Testing & CI

  • Massive test suite expansion (#90): Added 14 new test modules (~3,900 lines) covering steppers, spectral operators, nonlinear functions, IC generators, visualization, ETDRK, metrics, interpolation, and utilities.
  • Code coverage setup (#89): Integrated pytest-cov and Codecov reporting into CI.
  • Optional dependency groups (#82): Test and visualization dependencies are now installable via pip install exponax[test] and pip install exponax[vape4d].

Documentation

  • Stepper overview page (#86): Comprehensive classification of all 20+ steppers with equations, Mermaid diagrams, and inheritance hierarchy.
  • Metrics tutorials (#85): Finalized introductory and advanced metrics notebooks with executable examples.
  • Improved README and design decisions (#88): Expanded design decisions document and restructured the README.
  • Burgers equation notation (#84): Corrected tensor product notation from u . u to u otimes u.
  • Updated logo (#83): New SVG logo throughout docs and README.
  • Typo and consistency fixes (#80): Fixes across 22 files for consistent terminology and formatting.

What's Changed

  • Add Optional Installs by @Ceyron in #82
  • Updated Logo by @Ceyron in #83
  • Add Stepper Overview to Docs by @Ceyron in #86
  • Update Burgers equation notation in documentation by @Ceyron in #84
  • Finalize the Metrics Notebooks by @Ceyron in #85
  • Improved README and docs pages in markdown by @Ceyron in #88
  • Setup Code Coverage by @Ceyron in #89
  • Replace ETDRK contour integral broadcast with jax.lax.scan by @Ceyron in #91
  • Fix 0-order case in Laplace operator by @Ceyron in #92
  • Add Additional Tests to increase coverage by @Ceyron in #90
  • Fix typos and inconsistencies by @Ceyron in #80
  • Add Navier Stokes steppers for 3D by @Ceyron in #75
  • Fix scaling mode in IC generators and std_one validation by @Ceyron in #93
  • Add Wave Equation Stepper with Change of Basis Transformation by @Ceyron in #74
  • Add post-dealiasing to nonlinear functions via fft/ifft wrapping by @Ceyron in #96
  • Fix Nyquist artifact in Fourier-space IC generators via physical-space white noise by @Ceyron in #97
  • Validate Kolmogorov Stepper in 2D & 3D by @Ceyron in #99

Full Changelog: v0.1.1...v0.2.0