solve_wave_3d
Solve the 3D wave equation on a unit cube with Dirichlet boundaries using an explicit finite-difference scheme, returning downsampled fields and saving full results.
Instructions
Solve u_tt = c^2 (u_xx + u_yy + u_zz) on the unit cube.
``nx``, ``ny``, ``nz`` are the number of intervals per axis and ``nt`` the
number of time steps. The interior uses the explicit second-order central
scheme; the first time level uses the Taylor expansion
``u(dt) = u0 + dt*v0 + c^2*dt^2/2 * Laplacian(u0)``. All six faces use the
constant Dirichlet value ``boundary``.
Stability requires ``c*dt*sqrt(3)/min(dx,dy,dz) <= 1``. Grids above
500,000 cells and histories above 20,000,000 stored points are rejected.
The full (t, z, y, x) grid is saved to .npz; returned arrays are
downsampled to at most 20 points per spatial axis and 20 time points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| c | Yes | ||
| nt | Yes | ||
| nx | Yes | ||
| ny | Yes | ||
| nz | Yes | ||
| t_end | Yes | ||
| boundary | No | ||
| initial_velocity | No | 0 | |
| initial_displacement | Yes |