Skip to content

Wave 4--6 independent references

These NumPy-only references are independent of production Newton kernels. The physical wrappers retain the structured GFreeObservables container but scale every value to SI exactly once with G_SI.

These experimental symbols describe implemented calculation paths rather than a general accuracy guarantee. Read Limitations and non-guarantees and the narrow SPECFEM3D Cartesian profile before using the external-field paths for quantitative work.

Streaming fixed-mesh exchange

The following experimental API preserves source order and trailing observable components, uses bounded blocks, and applies G_SI only at the observable layer.

gragra.integrators.SeriesMetadata dataclass

Immutable geometry and sample-axis facts shared by every replay.

Stores immutable geometry, IDs, axis, and frequency-phase metadata shared by each replayable fixed-mesh source-series provider.

gragra.integrators.SeriesProvider

Replayable factory plus immutable public metadata.

Represents a replayable fixed-mesh source block factory with immutable global metadata and full block-coverage validation.

gragra.integrators.ScalarSourceSeriesBlock dataclass

One sample/source slab of signed scalar mass weights.

Carries a bounded scalar mass-weight slab with its source offset and sample slice for G-free integration.

gragra.integrators.DisplacementSourceSeriesBlock dataclass

One sample/source slab with real mass separate from displacement.

Carries a bounded background-mass and vector-displacement slab without collapsing those physically distinct quantities.

gragra.integrators.as_series_provider

as_series_provider(
    series_or_metadata: Any, factory: Callable | None = None
) -> SeriesProvider

Adapt accepted fixed-mesh series or explicit metadata/factory.

Builds a replayable fixed-mesh provider from a supported scalar, displacement, or surface-density series.

gragra.integrators.iter_g_free_blocks

iter_g_free_blocks(
    provider: SeriesProvider,
    targets: Any,
    *,
    observable: str,
    sample_block_size: int = DEFAULT_SAMPLE_BLOCK_SIZE,
    source_block_size: int = DEFAULT_SOURCE_BLOCK_SIZE,
    target_block_size: int = DEFAULT_TARGET_BLOCK_SIZE,
    kernel_chunk_size: int = DEFAULT_KERNEL_CHUNK_SIZE,
    backend: str = "numpy",
    softening_m: float = 0.0,
    memory_budget_bytes: int = DEFAULT_MEMORY_BUDGET_BYTES,
) -> Iterator[InternalGFreeBlock]

Yield sample-major, target-minor G-free blocks after a full preflight.

Yields validated bounded G-free observable blocks over sample and target tiles, without applying the gravitational constant.

gragra.observables.ObservableSeriesBlock dataclass

A defensive, read-only (sample,target,...) result slab.

Stores a defensive read-only observable slab with explicit sample and target coverage slices.

gragra.observables.stream_observable

stream_observable(provider: Any, targets: Any, **kwargs)

Yield immutable observable blocks, applying G_SI exactly once.

Converts each G-free streaming slab to its SI observable exactly once while preserving the block coverage and trailing component axes.

gragra.observables.collect_observable_blocks

collect_observable_blocks(
    blocks,
    *,
    sample_count: int,
    target_count: int,
    axis_kind: str,
) -> np.ndarray

Collect a complete block tiling into the package's public axis order.

Collects a complete validated set of SI observable blocks into public time or frequency axis order.

gragra.observables.RigidMotionBlock dataclass

One immutable SI-valued tile, indexed by motion then target.

Stores a defensive read-only rigid-motion observable block with explicit sample and target coverage.

gragra.observables.rigid_motion_observable

rigid_motion_observable(
    source,
    transform,
    targets,
    *,
    observable: str,
    softening_m: float = 0.0,
    memory_budget_bytes: int = 2 * 1024**3,
    motion_block_size: int = 1,
    target_block_size: int = 128,
    source_block_size: int = 8192,
    kernel_chunk_size: int = 1024,
) -> np.ndarray

Collect all SI tiles into a dense (frame, target, ...) result.

Evaluates the SI gravitational observable for a prescribed rigid-body motion across target points.

gragra.observables.stream_rigid_motion_observable

stream_rigid_motion_observable(
    source,
    transform,
    targets,
    *,
    observable: str,
    softening_m: float = 0.0,
    memory_budget_bytes: int = 2 * 1024**3,
    motion_block_size: int = 1,
    target_block_size: int = 128,
    source_block_size: int = 8192,
    kernel_chunk_size: int = 1024,
)

Return an iterator of SI blocks for a prescribed rigid transform.

Option and input metadata validation, defensive snapshots, and the final memory plan are eager. Provider scans and zero-softening collision preflight run when iteration starts, before any public block can be yielded. Values use axes (frame, target) followed by components and have SI units.

Yields streaming SI observable blocks for prescribed rigid-body motions.

gragra.adapters.read_fixed_mesh_series_hdf5

read_fixed_mesh_series_hdf5(
    path: str | Path,
    *,
    metadata_sample_block_size: int = 1,
    metadata_source_block_size: int = 8192,
)

Return a replayable provider backed by explicit HDF5 hyperslabs.

Reads the bounded gragra.fixed-mesh-series HDF5 profile after validating the version, completion state, geometry, IDs, units, and phase metadata.

gragra.adapters.write_fixed_mesh_series_hdf5

write_fixed_mesh_series_hdf5(
    path: str | Path,
    series: Any,
    *,
    sample_block_size: int = 1,
    source_block_size: int = 8192,
) -> Path

Write, read back, and atomically publish one fixed-mesh series.

Writes a fixed-mesh input series through a readback-validated partial file and only then publishes the complete HDF5 profile.

gragra.adapters.write_observable_series_hdf5

write_observable_series_hdf5(
    path: str | Path,
    blocks,
    *,
    sample_count: int,
    target_count: int,
    axis_kind: str,
    axis_values: Any,
    targets_m: Any,
    observable: str,
    coordinate_frame: str,
    coordinate_origin_m: Any,
    t_ref_s: float | None = None,
    phase_origin_m: Any | None = None,
    fourier_convention: str | None = None,
    sample_block_size: int = 1,
    target_block_size: int = 128,
) -> Path

Persist a complete observable block tiling through .partial.

Writes validated SI observable blocks with bounded readback and explicit time/frequency metadata.

gragra.adapters.SpecfemGLLStreamReader

Validate and expose a canonical SPECFEM file without loading its field.

Streams canonical SPECFEM GLL slabs through shared eager-reader validation, preserving all element-local 125-point IDs and weights.

gragra.analytic.GFreeObservables dataclass

Potential, acceleration, and gradient with static or series axes.

Static shapes are (M,), (M,3), (M,3,3). Series shapes are (S,M), (S,M,3), (S,M,3,3). No axis is flattened or broadcast.

The read-only potential, acceleration, and gravity-gradient container keeps static or leading-sample axes without flattening either representation.

gragra.analytic.QuadratureConvergence dataclass

Immutable evidence for an adaptive independent quadrature.

The immutable quadrature evidence records convergence status, error, orders, subdivision depth, and the independent reference evaluation budget.

gragra.observables.point_mass_observables

point_mass_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI point-mass reference observables from literal independent Newton expressions while returning the shared structured container.

gragra.observables.multipole_observables

multipole_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI monopole-plus-second-moment reference observables for far-field comparisons without reusing production multipole code.

gragra.observables.solid_cylinder_observables

solid_cylinder_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI reference observables for a finite cylinder using independent radial, angular, and axial quadrature.

gragra.observables.opposed_rotor_observables

opposed_rotor_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI time-series observables for the fixed opposed-cylinder rotor geometry while retaining its input sample order.

gragra.observables.opposed_rotor_leading_phasor

opposed_rotor_leading_phasor(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes the SI leading two-omega phasor from the rotor's analytic second moment rather than from a sampled discrete Fourier transform.

gragra.observables.passing_cuboid_observables

passing_cuboid_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI time-series observables for the prescribed passing cuboid and its fixed target coordinates.

gragra.observables.integrate_box_observables

integrate_box_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI exterior-domain box observables with independent tensor-product quadrature and explicit material-target exclusion.

gragra.observables.integrate_displacement_box_observables

integrate_displacement_box_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI linearized box-displacement observables while retaining density and displacement as separate inputs.

gragra.observables.adaptive_box_observables

adaptive_box_observables(*args: Any, **kwargs: Any)

Computes SI box observables with adaptive independent quadrature and returns the value together with its convergence evidence.

gragra.observables.adaptive_displacement_box_observables

adaptive_displacement_box_observables(
    *args: Any, **kwargs: Any
)

Computes SI displacement-box observables with adaptive independent quadrature and returns the value together with its convergence evidence.

gragra.observables.host_inclusion_observables

host_inclusion_observables(*args: Any, **kwargs: Any)

Computes SI host-and-inclusion observables after partitioning material interfaces so the contrast is counted exactly once.

gragra.observables.acoustic_finite_box_observables

acoustic_finite_box_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI finite-air-box acoustic-density observables for the documented fixed-ground geometry and exterior targets.

gragra.observables.acoustic_infinite_halfspace_observables

acoustic_infinite_halfspace_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI infinite horizontal air-halfspace observables from the independent horizontal-Fourier reference formula.

gragra.observables.rayleigh_halfspace_observables

rayleigh_halfspace_observables(
    *args: Any, **kwargs: Any
) -> GFreeObservables

Computes SI Rayleigh halfspace observables from the independently bracketed secular root and a single bulk-plus-surface-sheet contribution.