The question we will answer

Can you tell whether a diffusion calculation is correct? A smooth picture is not enough. Follow one periodic field from samples through derivatives and time stepping to a running C++ program, then split the same problem across MPI ranks.

\[ u_t=D\nabla^2u,\qquad u(x,0)=1+0.1\cos(kx),\qquad k=\frac{2\pi m}{L}. \]

The independent answer is \(u(x,t)=1+0.1e^{-Dk^2t}\cos(kx)\). Every chapter returns to that field. The browser uses a one-dimensional phase interval of length \(2\pi\). The C++ starter uses a three-dimensional unit grid, with a field that varies only along \(x\); we will translate the units explicitly.

Choose your route

Chapter You will be able to… Suggested study time
1. Sampling Explain why two different waves have identical samples 15 min
2. Derivatives Derive a local stencil and a Fourier derivative 20 min
3. Diffusion Predict decay, sign changes and instability 20 min
4. Error Separate spatial and temporal error with controlled refinement 20 min
5. C++ Run the canonical starter and check its output against a formula 25 min
6. MPI Explain halos and verify the same global result on two ranks 20 min

The times are suggestions, not a timer. Read the derivations, predict the result before moving a control, then open each worked checkpoint. You can mark a chapter understood using the optional browser-local progress control above.

What you need

For chapters 1–4: basic calculus, complex exponentials and a modern browser. You can read all equations and worked answers without JavaScript. The plots need JavaScript; their small reference calculations run locally in the browser. Each experiment offers a shareable parameter link and its current numerical values as CSV.

For chapters 5–6: basic C++, Python 3 for the optional checker, an installed OpenPFC SDK and its matching compiler/MPI environment. A CPU SDK is enough; the diffusion starter does not require HeFFTe or a GPU. You need permission to run two local MPI processes or an appropriate allocation on a cluster.

What this course checks

We use an analytic solution, an independent discrete-mode formula, conservation of the mean and equality of global fields across rank counts. Those checks have different jobs. A conserved mean does not prove the decay rate is right; a stable method does not prove its error is small; agreement across ranks does not prove the serial discretization is accurate.

The recorded C++ reference comes from an actual clean SDK build. The interactive plots are mathematical teaching calculations, not measured solver output. This first course covers periodic, constant-coefficient linear diffusion. Boundaries, nonlinear aliasing, variable coefficients and implicit solvers need additional analysis.