Skip to content

API reference

The API reference is generated directly from the source-code docstrings via mkdocstrings. Each subpage corresponds to one subpackage.

  • World — top-level container (soil, electrodes, conductors, sources, boundary, concrete-shell registry).
  • Soil — soil models.
  • Geometry — electrode and conductor geometries.
  • Conductors — conductors, PEN, cable shields.
  • Sources — current and voltage sources (discriminated union, SourceAdapter).
  • Boundary — boundary-condition model and revert-warning contract.
  • Solver — numerical field solver.
  • Coupling — galvanic and inductive coupling.
  • Postprocess — potentials, voltages, currents, plots.
  • Diagnostics — pre-solve structural checks (world_statistics, expected_segments, check_segment_resolution).
  • Validation — post-solve cross-engine consistency check (compare_engines).
  • IO — JSON export and the bridge to groundinsight.
  • Geo / OSM — optional OSM building footprints, projection helpers, and OsmBuildingPlacement.
  • Generators — world-generator framework (TnNetworkGenerator, distributions, spec layer; ADR-0009).
  • References — analytical reference formulas (Dwight, Carson, Oeding) used in plausibility tests.

Top-level package

The most relevant classes and factory functions are re-exported on the package level:

import groundfield as gf

soil = gf.TwoLayerSoil(rho_1=100.0, rho_2=500.0, h_1=2.0)
world = gf.create_world(soil=soil)
gf.create_electrode(world, "ring", name="g1",
                    center=(0.0, 0.0, 0.8), radius=5.0)
gf.create_source(world, attached_to="g1", magnitude=1.0)
result = gf.create_engine(backend="image",
                          frequencies=[50.0]).solve(world)