Skip to content

gragra

What gragra computes

gragra computes Newtonian gravity perturbations by forward integration. You supply a mass distribution, a mass-density perturbation, or a displacement field; gragra returns the gravitational potential, acceleration, and gravity-gradient tensor at the observation points you specify. Its most common use is estimating seismic Newtonian-noise contributions to gravitational-wave detectors.

Every calculation follows the same four steps: a source (points, volumes, surfaces, or a field you loaded), a geometry that discretizes it, an integrator that sums the geometric kernel against the source weights, and an observable that turns that sum into a physical quantity in SI units. What the layers are and why the boundary between them is drawn where it is are described in What gragra computes; the sign, unit and axis conventions that every result depends on are in Coordinates, signs and units.

What gragra does not do

gragra does not solve a dynamical PDE — not elastodynamics, not fluid flow, not detector response. It ships closed-form kinematic field constructors (plane waves, Rayleigh eigenfunctions, stochastic P/S realizations) that you can use as input, but for anything else you supply the field yourself and gragra integrates it.

gragra is not a multi-solver platform. SPECFEM3D Cartesian has a native export path and documented narrow HDF5 reader. The mesh extra also provides a bounded Foundation OpenFOAM 14 patch 20260724 legacy-ASCII .vtk density adapter. Neither path supports general solver formats, native polyMesh, or CFD-solver runs; see Limitations and non-guarantees.

Both statements have consequences that are easy to discover too late — which physical cases have a dedicated analytic treatment and which do not, which code paths are checked automatically and which are checked only on one machine. They are collected in Limitations and non-guarantees, which is the page to read before you rely on a number.

Research scope

This repository distributes the public gragra package and documents its interfaces. It does not certify arbitrary research calculations or every scientific condition. Run research-required checks locally with the exact code revision, environment, inputs and conditions for the work. Public CI results describe only the checks selected by the repository workflow.

Installation covers installation from PyPI, editable source installs, and optional extras. For reproducibility, record the installed package version, or the exact commit if using a changing source checkout.

Where to start

Three routes through the documentation, chosen by what you already have in hand. Each is two pages long; everything else can wait.

I have a seismic displacement field

Your field comes from an external solver, a measurement, or your own code, and you want the gravity perturbation it produces.

  1. Displacement and density-perturbation fields — how a displacement field becomes a mass-density perturbation, why the bulk and surface contributions are separate, and what happens to each when your input is incomplete.
  2. External field data and HDF5 — the file layouts gragra reads, and what you have to convert yourself.

If your field comes from SPECFEM3D Cartesian, read SPECFEM3D Cartesian as well, and read it before you plan the work: it states exactly where the supported path ends.

I have point masses or simple shapes

You are modelling vehicles, equipment, water bodies, or any object whose motion you can describe directly.

  1. Minimal example — a complete calculation in a few lines, with the result checked against the closed-form value.
  2. Geometry and discretization — turning a shape into source points, and how the discretization error behaves.

From there, Point sources and Observables document the source types and the four point observables in full.

I want plane waves and coherent statistics

You are working in the frequency domain with complex amplitudes, directional averages, or cross-spectral quantities.

  1. Waves — plane waves, polarizations, Rayleigh eigenfunctions, and the complex-amplitude convention they all share.
  2. Coherent responses and cross statistics — coherent observables, the gravitoelastic tensor, and cross-spectral densities, including which of them carry which power of the gravitational constant.

Complex outputs explains what a complex result means here, and what it does not mean.

For a broader map of the physical models, start with the Physics reference. For a map of the computational paths and their numerical limits, see Numerical methods.

How to read the verification claims on this site

Every page that documents a public symbol carries a Verification Block for it: a fixed eight-field table naming what the result was checked against, at what level of agreement, by which test, under which conditions — and, in its own field, what that evidence does not cover. The vocabulary is closed and the test references are machine-checked, so a block cannot quietly become a paragraph of reassurance.

Read How gragra is verified first. It explains why the size of the test suite is not the evidence, and gives, method by method, the kind of error each check catches and the kind it is structurally blind to. Verification matrix is the index of every block; Literature coverage says how much of the standard reference catalogue of physical cases has a dedicated treatment here; Limitations and non-guarantees collects what none of it covers.