Skip to content

PropSEM

The spectral-element counterpart of PropTorch: the same constructor options with the same meaning, models=[...] input, source_type / receiver_type selection and a (nshots, nt, nrec, ncomp) seismogram, with a class from SEM equations as the equation. The options, the source types and the receiver components are explained in the SEM propagator guide.

sweep.sem.PropSEM

PropSEM(
    equation=AcousticSEM2D,
    *,
    shape,
    dh,
    dt,
    nt=None,
    n_order: int = 4,
    abcn=None,
    free_surface=False,
    topography=None,
    memory=None,
    f_dominant: float = 10.0,
    impl=None,
    device=None,
    dev=None,
    dtype: dtype = torch.float32,
    density: float = 1000.0,
    bs_band_mode: str = "full",
    bs_store_dtype_elem=None,
    source_type=None,
    receiver_type=None,
    equation_options=None,
    **kwargs
)

SEM propagator with the FD PropTorch constructor and call.

The options PropTorch has mean what they mean there: shape is the model and abcn (grid cells, whole elements: a multiple of n_order; default ten elements) the absorbing layer added outside it; free_surface takes PropTorch's edge spec (default False) and topography its per-column surface rows; memory is Full(), BoundarySaving(storage_dtype=...) or Ckpt(chunks=...); impl None is 'auto'; nt may be left to the wavelet; device or dev. The rest is the SEM's own: the equation class and n_order, f_dominant (the C-PML's frequency), density (the fixed density of :class:AcousticPotentialSEM2D), bs_band_mode and bs_store_dtype_elem (what boundary saving keeps of the C-PML band, and at what precision its element histories on impl='c'), and equation_options, the equation's own build keywords (e.g. Biot's viscous_q).

mesh property

mesh

The full mesh, built on first access and then shared -- the same object on every read, so id(self.mesh)-keyed caches behave as they did when the constructor built it.

forward

forward(wavelet, sources, receivers, models=None, **kw)

See :meth:_forward_fields for the full option reference. This wrapper adds the derived receiver components: requested p / vx / vy / vz are produced from the recorded base traces (p = -chi_ddot, v = u_dot) so callers get FD-aligned pressure / particle-velocity data without converting anything themselves.

hex8_layout

hex8_layout()

The mesh's O(nx + ny + nz) description -- axes and scalars, no arrays -- for a consumer that must not materialise the mesh (the DD strips). Only the flat hex8 family has one; every other family keeps the real mesh.

Follows the MESH, not the constructor: while no mesh exists it is derived from the stored build arguments (so a DD rank never builds the mesh), and once one exists -- built lazily, or assigned by the caller -- it is that mesh's own layout, so the compact DD path and the fused path can never describe two different geometries.

sweep.sem.prop_base.propsem_models

propsem_models(equation) -> list

The models= list PropSEM takes for equation, in order.

The positional models of build(), minus the ones PropSEM supplies itself: the acoustic potential form takes (vp, rho), but density= exists so that callers pass models=[vp] and rho is a constant the adapter fills in. sweep show reads the same list.

Mesh and time step

shape must tile into elements, (n - 1) % n_order == 0 on every axis, and the time step must satisfy the CFL condition on the smallest GLL spacing. suggest_discretization gives both from the domain, the velocities and the source frequency.

sweep.sem.suggest_discretization

suggest_discretization(
    x_max: float,
    z_max: float,
    *,
    v_min: float,
    v_max: float,
    f0: float,
    n_order: int = 4,
    ppw: float = 5.0,
    f_max_factor: float = 2.5,
    courant: float = 0.3,
    record_length: float | None = None
) -> SEMDiscretization

Suggest (nex, nez, dt[, nt]) for a 2-D SEM run.

Parameters

x_max, z_max Domain extent (m). v_min Slowest wave speed (m/s) — sets the spatial resolution. Use vs for elastic, vp for constant-density acoustic. v_max Fastest wave speed (m/s) — sets the CFL time step. Use vp. f0 Ricker central frequency (Hz). n_order GLL polynomial degree N (ngll = N + 1). Default 4. ppw Target GLL points per shortest wavelength. Default 5 (standard for N = 4); raise to 6–8 for extra margin / prettier wavefields. f_max_factor f_max / f0 for the source bandwidth. Default 2.5 (Ricker). courant CFL safety factor, below the ~0.4–0.5 N=4 stability limit. Default 0.3 (leaves margin for mild mesh deformation / topography). record_length If given (s), also return nt = ceil(record_length / dt).

Returns

SEMDiscretization .nex .nez .dt (and .nt) ready to use, plus diagnostics.

Examples

d = suggest_discretization(1280, 900, v_min=1200, v_max=2400, f0=12, ... record_length=0.6) mesh = build_topography_quad9(nex=d.nex, nez=d.nez, x_max=1280, ... z_bottom=900, z_top_fn=z_top, n_order=d.n_order)

propagate with dt=d.dt, nt=d.nt

sweep.sem.SEMDiscretization

SEMDiscretization(
    n_order: int,
    nex: int,
    nez: int,
    dt: float,
    nt: int | None,
    lambda_min: float,
    h_elem_x: float,
    h_elem_z: float,
    points_per_wavelength: float,
    courant: float,
)

Suggested SEM discretization parameters + the diagnostics behind them.