Repository navigation
Conversation
The SEM branch squashed onto dev: sweep.sem, test/sem, the SEM user guide and an SEM section of examples (notebooks 41-44: forward and backward, FD vs SEM on topography, Marmousi FWI, batched local windows). PropSEM takes PropTorch's constructor and call: abcn cells of absorbing layer outside the model and out of the gradient, the free_surface spec, per-column topography rows, memory=Full/BoundarySaving/Ckpt, impl=None, nt from the wavelet, the source names (sxx/szz a moment tensor with FD's waveform, stamped in every element on an element edge) and return_wavefield snapshots on the grid. Absolute paths and run-specific remarks are out; the branch's working notes stay untracked. impl='c' needs a core with the SEM entries, which the next commit adds, and says so; until then those tests skip. Three tests asserted what the hardware does not promise: the two peak-memory ratios now count the increment after a warm-up, and a CPU bit-identity is a float64 round-off bound.
The 43 SEM entries join the core's C API as kind 3: sweep_sem_call takes the input struct and the DD phase's step index, sweep_entry_struct names the struct. The drivers take Buf twins that gen_input_core.py builds from the SEM specs, as for the FD inputs (C ABI 3). The Python inputs write every assignment into their twin, so a call hands the core a pointer. What the kernels receive, field for field, and the speed (within 1.6%) match the pybind build.
BiotVSSEM2DDeformed solves the FD Biot's velocity-stress-pressure form on the Quad9 mesh, with its eight coefficients and source/receiver names via PropSEM. The pore pressure is continuous and the Darcy flux element-local, so the fluid is the acoustic pressure SEM: with a continuous flux, as in SPECFEM2D, a point source excites grid-line modes (p up to 14x on the source's row, growing like 1/dh). The drag is integrated exactly per node over the flux copies; C-PML; open-pore surface, topography included; boundary saving refused. Receivers read element-local fields. Checked against analytic and wavenumber-integration solutions, FD Biot, SPECFEM2D (4e-4) and finite-difference gradients.
Point force fx/fz and flux sources qx/qz; BiotAnisoPermSEM2DDeformed (drag tensor); viscous attenuation via equation_options viscous_q (standard linear solid). Fluid (rho = 0) and dry elastic (M = 0) regions in one model: open pores to a fluid, sealed to a dry solid, the interface terms exact transposes; sources load only their medium's fields; absent coefficients get no gradient. sweep.equations.biot_params: drag tensor, fluid/dry coefficients, Morency 2009 families and kernels. PropSEM(equation_options=...). Checked against analytic solutions, AcousticElasticSEM2D / ElasticVS (round-off), reciprocity and SPECFEM2D (features 0.02-0.2%, couplings 0.01-0.08%).
Three plotting scripts named test_* broke collection (module-level matplotlib, absent from the CI install): renamed smoketest_*. The C-PML gates read one rollout, references are cached and absorbing layers thinned where they are not under test: test/sem 334 -> 253 s, the same numbers. The checkpoint-gradient check had atol 1e-10 on a 1e-16 gradient (now relative); a transpose check drew an unseeded direction and failed 2% of the time (now seeded).
The FD gradient checks passed through pytest.approx's default abs=1e-12 (|J' dm| ~ 1e-17): now rel 1e-6 with abs 0, a 1e-5 step, the C-PML speed held and the bump off the edge cells (measured 1e-10 - 1e-7). The batch-vs-loop receiver check is to rounding (2e-6 of the peak on CPU torch 2.14). Thinner C-PML where it is not under test, cached and merged runs, a compact open-pore case, the FD match uncompiled: 235 -> 111 s.
`sweep list equations` adds a table of the SEM equations (mesh, models, CUDA kernel, ready), and `sweep show` describes an SEM class: mesh, C-PML, fields, source and receiver types, the models PropSEM takes. Both read sweep.sem's registry through two helpers, sweep.sem.equations.summary (describe() is built on it) and prop_base.propsem_models (PropSEM uses it). docs/api/sem/ covers PropSEM, the equations, meshes and C-PML, SEMPropagator and SEM DD; the CLI page and the SEM guides follow.
`sweep show` prints the source_type names an equation declares for PropSEM (Biot's force, moment and injections) instead of its source fields, and docs/api/sem/equations.md documents the two Biot classes.
sem: Biot poroelastic waves (2-D)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sweep.sem: a spectral-element solver for irregular topography. Quad9 / Hex27 meshes fitted to the free surface; acoustic (potential), elastic and fluid-solid in 2-D, acoustic and elastic in 3-D; C-PML; boundary saving, shot batching and an x-strip domain decomposition.PropSEMtakesPropTorch's constructor and call (abcn,free_surface,topographyrows,memory,impl, FD source names, grid snapshots). User guide:docs/user-guide/sem.md; examples: notebooks 41-44.sweep list equationslists the SEM equations after the FD ones andsweep showdescribes one; the API reference isdocs/api/sem/.impl='c': the 43 SEM CUDA entries join the torch-free core as kind 3 of the C API (C ABI 3), numbered after dev's qP entries and dispatched by name.Also: the peak-memory check in
test_eager_boundary_savingnow measures what the rollout adds to the memory the process already holds (the cuBLAS workspaces earlier GPU tests leave behind made it fail in a full run).Checks: full CPU suite as dev; full GPU suite with
impl='c'passes; docs build with dev's warnings only.🤖 Generated with Claude Code