Acoustic¶
class Acoustic(
spatial_order=4,
device="cpu",
backend="torch",
dim=2,
)
Implementation:
src/sweep/equations/acoustic.py
Second-order 2D acoustic wave equation with CPML auxiliary fields.
Note
This is the most common scalar-wave equation in the codebase and is the default choice for many forward modeling and acoustic inversion examples.
Parameters¶
spatial_order(int, optional): Finite-difference order. It should be an even number such as4or8.device(device orstr, optional): Target device used to place operator kernels and backend-specific tensors.backend(str, optional): Numerical backend, typically"torch"or"jax". If you plan to run withPropCUDA, this should still normally be"torch"rather than"cuda".dim(int, optional): Stored dimensionality. For this class the intended value is2.
Models¶
models(list[str]):["vp"]
You must provide one model tensor:
vp: P-wave velocity model
Wavefields¶
wavefields(list[str]):["h1", "h2", "psix", "psiz", "zetax", "zetaz"]
The first two are the main second-order wavefield states, and the remaining entries are CPML auxiliary fields.
Field Metadata¶
This class defines structured field metadata through FieldSpec.
Model Metadata¶
This class defines structured model metadata through ModelSpec.
Required models:
vpalias:velocityMeaning: acoustic P-wave velocity model Units:m/s
User-facing fields:
h1aliases:pressure,pMeaning: primary acoustic pressure-like wavefield
Internal fields:
h2: previous-step pressure-like statepsix,psiz,zetax,zetaz: CPML auxiliary fields
Useful helpers:
available_fields(): returns the user-facing fields, excluding CPML fieldsavailable_fields(role="source"): valid source injection fieldsavailable_fields(role="receiver"): valid receiver sampling fieldsdescribe_field("h1")ordescribe_field("pressure"): returns the field description
Defaults:
default_source_fields:["h1"]default_receiver_fields:["h1"]
Backend Behavior¶
- PyTorch path uses separable Laplace operators
- CUDA-backed PyTorch binding is available through
_C() - JAX path is also supported
CUDA Layout¶
For the compiled CUDA propagator, this equation exposes:
cuda_layout
This groups the CUDA runtime buffer metadata needed by PropCUDA instead of
storing separate base_nvar, pml_nvar, and checkpoint-count properties on
the equation class.
Torch Binding¶
supports_torch_binding():True
Compiled entry points exposed by this class are used by PropCUDA.