Operators¶
This section documents the three spatial-derivative operator classes in
sweep.operators. For the conceptual / how-to guide and decision tree see
Operators.
from sweep.operators import (
LaplaceGradientOps, # Laplacian + gradient bundle
StaggeredDerivative, # 1st-order staggered FD
RSGDerivative, # rotated staggered grid (2-D)
)
You usually do not instantiate these directly:
LaplaceGradientOpsis mixed intoSecondOrderEquation— accessed asself.laplacian_2d(...),self.separable_d2_2d(...),self.gradient(...).StaggeredDerivativeis built byFirstOrderEquation.__init__and stored onself.pd.RSGDerivativeis constructed explicitly byElasticTTI/ElasticTTISGasself.rsg.
LaplaceGradientOps¶
sweep.operators.LaplaceGradientOps ¶
Backend-dispatched second-derivative and gradient operator bundle.
On construction this class imports five backend-specific functions
from either :mod:sweep.operators.torch or :mod:sweep.operators.jax
and binds them as instance attributes:
- :func:
separable_d2_2d/ :func:separable_d2_3d— return per-axis second derivatives(d2z, d2x[, d2y])for anisotropic equations. - :func:
laplacian_2d/ :func:laplacian_3d— return the scalar isotropic Laplacian∇²u(= sum of the per-axis components). - :func:
gradient— first-order partial derivative along one axis.
Mixed into :class:sweep.equations.base.SecondOrderEquation so every
2-D / 3-D second-order acoustic equation can call
self.laplacian_2d(...) or self.separable_d2_2d(...) etc.
without an explicit operator object.
Bind second-derivative + gradient operators for the chosen backend.
Parameters:
-
backend(str, default:'torch') –'torch'(default) or'jax'. The correspondingsweep.operators.<backend>module is imported lazily so installations that lack one backend stay importable.
StaggeredDerivative¶
sweep.operators.StaggeredDerivative ¶
RSGDerivative¶
sweep.operators.RSGDerivative ¶
2D rotated staggered-grid fused derivative operator.