Diagnostics¶
groundfield.diagnostics checks a world before a long solve: its
size, the discretisation quality, wires that are too close for the
thin-wire model, settings that have no effect, and — given a result —
truncated series. diagnose(world, engine) returns one aggregated
DiagnosticsReport with one line per cause (not per electrode); the
solve emits the same findings as warnings. The post-solve counterpart,
a comparison of several engines, is Validation.
| Function | Answers |
|---|---|
world_statistics(world) |
counts by kind, wire and conductor lengths, footprint |
expected_segments(world, engine) |
segments the discretiser will produce, per electrode and in total, the size of the nodal system and the engine's limit ("limit") |
check_segment_resolution(world, engine) |
thin-wire ratio, electrodes smaller than a segment, size budget (strings) |
check_segment_budget(world, engine) |
raises ResourceLimitError above the engine's limit Engine.max_segments (default HARD_LIMIT; used by the solver) |
diagnose(world, engine, result=None) |
all of the above plus mixed local and projected coordinates, close wires, rod ends at a layer interface, inert settings, series truncation |
Mathematical and physical context¶
The checks guard the assumptions of the thin-wire model (see Geometry):
-
Coordinates. A world whose points lie both within 10 km of the origin and beyond 1 000 km from it (horizontal distance) mixes local and projected coordinates: electrodes at UTM coordinates and a node given in a local system, almost always by mistake. It is solved as given, its two groups some 33 000 km apart (a return rod at local (80, 15) m for an outline and a rod at UTM coordinates: \(Z_{in}\) +0.43 %; a PEN cable to a cabinet at local coordinates: a 33 118 km conductor; audit W2B-04). Category
coordinates, a warning that names both groups and the conductors between them; the solve warns withMixedCoordinatesWarningtoo (user decision D5). A world that does not mix but whose horizontal extent exceeds 100 km is reported as information (two UTM zones, a zone prefix on some eastings only, a geometry in millimetres). See Units and conventions. -
Thin-wire ratio. The self term of a segment of length \(L\) and radius \(a\) behaves like \(2\ln(L/a)/L\) and loses dominance as \(L\) approaches \(a\); the check asks for \(L/a \ge 5\) (
MIN_THINWIRE_RATIO). - Resolution. An electrode feature shorter than one segment is represented only by the discretiser's floor (one segment per wire, eight per ring).
- Proximity. Two wires of different owners closer than five times the sum of their radii violate the point-source assumption that a source sees another wire only through its midpoint; the exact line-source kernel stays physical there.
- Interface contact. The thin-wire model has no end face. A rod
whose head or tip lies within one wire radius of a layer interface is
either entirely on one side of it (end at the interface) or touches the
other layer through a part shorter than its radius; the solid rod is
continuous in between. Against an axisymmetric model of the solid rod
(4.5 m, \(a\) = 8 mm, 1000/30 Ω·m) the thin wire reads +21 % with its tip
at the interface and −4.6 % 1 mm past it. A horizontal wire within a few
wire radii of a contrasting interface carries its current on the axis
while the solid wire's current crowds to the near side: +3.6 % at two
radii over a layer 33 times more conductive (audits W4A-07, W4B-02; the
reach per contrast is tabulated under
InterfaceContactWarningin the warnings reference). Categoryinterface_contact, alsoInterfaceContactWarningat the solve. - Size. The dense reaction matrix of \(N\) segments has \(N^2\)
entries (\(8N^2\) bytes, 3.0 GiB at \(N\) = 20 000); the work per
excitation grows like \(N^2\) and the direct solve like \(N^3\). The
dense nodal system of \(n\) unknowns (current owners, nodes and
branches, every conductor sub-piece included) takes \(16n^2\) bytes.
At or above the engine's notice size the report informs that a
solve takes minutes (an info finding; every
Engine.solve, with any backend, emits it as aUserWarning—solve_mutual_matrixandsolve_mutual_fielddo not); above the engine's limit the solver refuses to start withResourceLimitError, before anything of that size is allocated (every segment backend andsolve_mutual_*). Both are set per engine and count both sizes: the limit withEngine(max_segments=...), the notice withEngine(warn_segments=...)(positive integers; user decisions Q17 and Q31 of 2026.11). An engine that leaves them atNoneuses the module constantsHARD_LIMIT(20 000) andSOFT_LIMIT(5 000), read at solve time. The two are not checked against each other: a notice above the hard limit never appears, because such a world is refused first.expected_segments(...)["limit"],report.context["max_segments"]andFieldResult.metadata ["max_segments"]show the limit that applies,report.context["warn_segments"]the notice size; the provenance block of a result keeps both requests.
The segment counts follow the discretisation of the image and MoM
families; for fem they do not predict the cost. fem does not use those
segments: its problem is the mesh of each driven cluster (2 400 nodes at
the default resolution in homogeneous soil, growing with the depth of the
layer stack to about 4 100 at 30 m and 6 200 at 1 km, independent of
segment_length), so its
Engine.solve still emits the notice from the segment count but does not
refuse a world above Engine.max_segments.
Example¶
import groundfield as gf
world = gf.create_world(soil=gf.HomogeneousSoil(rho=100.0))
gf.create_electrode(world, "rod", name="a", position=(0.0, 0.0, 0.0), length=3.0, wire_radius=0.008)
gf.create_electrode(world, "rod", name="b", position=(0.018, 0.0, 0.0), length=3.0, wire_radius=0.008)
gf.create_source(world, attached_to="a", magnitude=1.0)
engine = gf.create_engine(segment_length=0.5)
budget = gf.expected_segments(world, engine)
report = gf.diagnose(world, engine)
print(report) # proximity: 'a'–'b' close, axis distance 18 mm (clearance 2 mm) ...
assert budget["total"] == 12 # two rods of six 0.5 m segments
assert "proximity" in report.categories()
The limit is a property of the engine: a smaller one refuses this world
before the solve allocates anything, a larger one admits worlds beyond
HARD_LIMIT.
from groundfield.diagnostics import HARD_LIMIT, ResourceLimitError, check_segment_budget
try:
check_segment_budget(world, gf.create_engine(segment_length=0.5, max_segments=10))
except ResourceLimitError as error:
print(error) # ... discretises into 12 segments ..., more than Engine.max_segments = 10 ...
print(budget["limit"], gf.expected_segments(world, gf.create_engine(max_segments=50_000))["limit"])
The notice "solve time may run from seconds to minutes" works the same way:
SOFT_LIMIT is the default, Engine(warn_segments=...) moves it for one
engine, for instance down to a size that is already slow on a small
machine.
from groundfield.diagnostics import SOFT_LIMIT
early = gf.Engine(segment_length=0.5, warn_segments=10)
notice = gf.diagnose(world, early).by_category("budget")
print(notice[0].severity, notice[0].message) # info predicted total segment count 12 is at or above Engine.warn_segments = 10 — ...
print(gf.diagnose(world, engine).context["warn_segments"]) # 5000: SOFT_LIMIT
API reference¶
diagnostics ¶
Pre-solve world diagnostics — counts, mesh budget, resolution, proximity.
This module collects structural diagnostics that work directly
on a World (and optionally an
Engine and a solved
FieldResult). It is the typical
counterpart to groundfield.validation (a post-solve
cross-engine check):
diagnose()— one structured, aggregated report (DiagnosticsReport) of everything that limits the accuracy or the meaning of a solve: coordinates that mix local and projected systems, discretisation quality, segment budget, close or interpenetrating wires, inert configuration and, after the solve, series truncation. One line per cause, not per electrode (review finding 10.70).world_statistics()— aggregate counts and lengths, bounding box, footprint area, conductor-length statistics.expected_segments()— predicts the number of point-source segments that the image-family discretiser will produce per electrode kind, plus a total. Useful for budgeting wall-clock cost before kicking off a 200-EFH run.check_segment_resolution()— the discretisation part of the report as plain strings (thin-wire ratio, electrode size vs. segment length, segment budget), one string per cause. The solve emits each of them as one warning.check_segment_budget()— the hard resource guard of the solver pipeline: a world whose predicted segment count, or whose dense nodal system (every conductor sub-piece included), exceeds the engine's limit raisesResourceLimitErrorbefore anything of that size is allocated (finding 10.06; audit round 2, A2S-02). The limit isEngine.max_segments, orHARD_LIMITfor an engine that leaves it atNone(user decision Q17, 2026-11-08).
Validity envelope
- The segment counts follow the electrodes' own discretisation
(
segments()and siblings) including the split at the soil-layer interfaces, i.e. the image-family discretiser thatimage,image_2layer,image_nlayer,mom,mom_sommerfeld,cimandbemshare. FEM does not use it; for FEM the segment count is not predictive of cost. - Wire-length / segment computations follow the physical geometry. Sub-segment overheads from cluster-bonding, KCL pseudo-nodes and lumped-conductor branches are not double-counted.
Mathematical background of the checks
The image family represents every wire segment of length \(L\) and
radius \(a\) by a line (or point) source with uniform current and
evaluates the potential on its axis (thin-wire approximation). The
self term of the reaction matrix behaves like
\(2\ln(L/a)/L\); it loses dominance when \(L\) approaches \(a\), so the
thin-wire check asks for \(L \ge 5a\) (MIN_THINWIRE_RATIO). An
electrode feature shorter than one segment is represented by the
discretiser's lower floor only (one segment per wire, eight per ring),
which the resolution check reports. Two different wires closer than a
few radii violate the assumption of the point-source kernel that a
source sees another wire only through its midpoint: two bonded 3 m rods
of radius 8 mm, 2 mm apart, solve to 5.7 times the impedance of one rod
with the point kernel and to 0.998 times with the exact line kernel
(review finding 10.44); the proximity check uses
groundfield.conductors.find_close_wires() on the segments the
solver assembles. The dense reaction matrix of \(N\) segments has
\(N^2\) entries (8 bytes each); above
MATRIX_BUDGET_BYTES it is applied
in row blocks, so memory stays bounded but the work keeps growing like
\(N^2\) per excitation — the reason for the hard segment limit. The dense
augmented nodal system of \(n\) unknowns (current owners, nodes and
branches) is allocated whole, \(16 n^2\) bytes complex.
Resource limit
The limit is set per engine with Engine(max_segments=...), a
positive integer that bounds both sizes, the leakage segments and the
unknowns of the dense nodal system; None (the default) takes
HARD_LIMIT (20 000), read at call time, so a changed module
constant still acts as the default of every engine. Every function here
that takes an engine (check_segment_budget(),
expected_segments(), check_segment_resolution(),
diagnose()) and every segment backend, solve_mutual_matrix and
solve_mutual_field included, check against the same limit;
FieldResult.metadata["max_segments"] records it.
The soft notice is set per engine as well, Engine(warn_segments=...),
counted like max_segments (user decision Q31, 2026-11-08); None
(the default) takes SOFT_LIMIT (5 000), read at call time. At or
above this size every Engine.solve, with any backend, warns that it
may take from seconds to minutes on a laptop, and diagnose() reports
it as an info finding; solve_mutual_matrix and solve_mutual_field
check the hard limit but emit no notice. For fem the segment count is
not its problem size (its volume mesh is, limited by FemOptions.max_nodes
and max_nodes_3d); it counts the display segments that carry the point
sources of its result, which fem checks against the limit too. The two
sizes are not checked
against each other: a notice above the engine's hard limit never appears,
because such a world is refused first.
check_segment_resolution() and diagnose() (report.context
["warn_segments"]) use the engine's value.
References
- ADR-0003 (
docs/adr/0003-distributed-conductor-model.md) — distributed-conductor topology used byexpected_segments()for conductors with finitediscretize_segment_length.
HARD_LIMIT
module-attribute
¶
Default problem size above which the solver refuses to start.
The image-family pipeline, the mom family and solve_mutual_*
raise ResourceLimitError for a world whose predicted segment
count, or whose dense nodal system (current owners, nodes and branches,
every sub-piece of a distributed conductor included), exceeds the
engine's limit, before anything of that size is allocated (finding
10.06: a ring entered in millimetres predicts 62 832 segments; audit
round 2, A2S-02: an isolated conductor in mm-long sub-pieces). The limit
of one engine is Engine(max_segments=...); this constant is the
default of every engine that leaves max_segments at None and is
read at solve time, so setting groundfield.diagnostics.HARD_LIMIT
changes the default for the whole process.
MIN_THINWIRE_RATIO
module-attribute
¶
Minimum recommended ratio of segment_length to wire_radius.
Below this, the thin-wire approximation that underpins the
average-potential method becomes increasingly biased: the
self-action integral is computed under the assumption
segment_length >> wire_radius.
OVERLAP_FRACTION
module-attribute
¶
Shortest reported overlap, as a fraction of the shorter conductor.
The second threshold of the overlap check of diagnose(); see
OVERLAP_REL_LENGTH.
OVERLAP_REL_LENGTH
module-attribute
¶
Shortest reported overlap of two inductive conductors, in touching distances.
Overlap of inductive conductors (check overlap of diagnose()):
two conductors closer than touching (axis distance below the sum of
their radii, d_t) lie beside each other when that stretch is longer than
OVERLAP_REL_LENGTH * d_t and OVERLAP_FRACTION of the shorter conductor.
Two conductors leaving a common point at an angle phi stay closer than
touching over about d_t / phi; the touching rule changes their mutual
inductance over that stretch by about (mu0 / 2 pi) d_t / phi (the mean
of ln(d_t / d) along a linear divergence is 1), against a self
inductance of about (mu0 / 2 pi) l (ln(2 l / r) - 1), ten times
(mu0 / 2 pi) l for the cables of an LV network. A stretch of 5 % of the
shorter conductor therefore moves the coupling by about 0.5 % of a self
inductance; a branch is reported only below about d_t / (0.05 l): 0.46
deg for 12 mm touching and a 30 m drop, 0.1 rad at most.
SOFT_LIMIT
module-attribute
¶
Problem size above which the user should be aware of cost.
Compared with the segment count and with the size of the dense nodal
system (expected_segments(), key nodal_unknowns).
The reaction matrix scales as \(O(N^2)\) in memory (bounded by row blocks above the kernel budget) and the multi-port assembly as \(O(N^2)\) per excitation, so ~ 5 000 segments is roughly where solve time becomes minutes rather than seconds on a typical laptop.
The default of every engine that leaves Engine.warn_segments at
None (user decision Q31), read at call time; an engine moves the
notice with Engine(warn_segments=...).
Diagnostic
dataclass
¶
Diagnostic(category: str, severity: Severity, subjects: tuple[str, ...], message: str, data: dict[str, Any] = dict())
One finding of diagnose().
Attributes:
| Name | Type | Description |
|---|---|---|
category |
str
|
Cause: |
severity |
Severity
|
|
subjects |
tuple[str, ...]
|
Names the finding is about (electrodes, conductors, the world, a setting). |
message |
str
|
One sentence for this subject. |
data |
dict[str, Any]
|
Machine-readable values (units in the key names). |
DiagnosticsReport
dataclass
¶
Aggregated result of diagnose().
Attributes:
| Name | Type | Description |
|---|---|---|
findings |
list[Diagnostic]
|
All findings, in the order the checks ran. |
context |
dict[str, Any]
|
Values the aggregated text refers to ( |
by_category ¶
categories ¶
Causes present in the report, in check order.
lines ¶
One aggregated line per cause.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_severity
|
Severity
|
|
'info'
|
Source code in src/groundfield/diagnostics.py
summary ¶
to_records ¶
The findings as plain dictionaries (for tables and JSON).
Source code in src/groundfield/diagnostics.py
warn ¶
Emit the report as one DiagnosticsWarning (if not empty).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_severity
|
Severity
|
Lowest severity that is included (default |
'warning'
|
stacklevel
|
int
|
Passed to |
2
|
Source code in src/groundfield/diagnostics.py
DiagnosticsWarning ¶
Bases: UserWarning
One aggregated warning with the findings of diagnose().
MixedCoordinatesWarning ¶
Bases: UserWarning
The world mixes local and projected coordinates (user decision D5).
Emitted once per solve by every solve in a local frame (the image
family, mom, mom_sommerfeld and solve_mutual_*), before
anything is discretised, when points of the world lie both within
10 km of the origin and beyond 1000 km from it: electrodes at UTM or
Gauss-Krüger coordinates and a node or electrode near (0, 0), almost
always given in the wrong system by mistake. The world is solved as
given, its two groups some 33 000 km apart (audit W2B-04, measured with
a 12 m × 7 m outline and a 3 m rod at UTM coordinates: a return rod given
at local (80, 15) m raises Z_in by 0.43 %, a PEN cable to a cabinet at local coordinates
becomes a 33 118 km conductor, Z_in 7494 + j25396 Ω instead of
5.39 + j0.19 Ω at 50 Hz with Carson's earth return, and the Sommerfeld
earth return does not finish).
diagnose() reports the same world under coordinates.
Remedy: give every point in one coordinate system.
ResourceLimitError ¶
Bases: ValueError
The predicted problem size exceeds the configured limit.
Raised before any array of the problem size is allocated. Check the
units of the geometry (metres) and Engine.segment_length; to
solve a large world on purpose, raise the limit of the engine,
Engine(max_segments=...) (default
groundfield.diagnostics.HARD_LIMIT).
check_budget_ok ¶
Whether the world is within the engine's limit (no exception).
The limit is engine.max_segments, or HARD_LIMIT if the
engine leaves it at None (see check_segment_budget()).
Source code in src/groundfield/diagnostics.py
check_segment_budget ¶
check_segment_budget(world: 'World', engine: 'Engine', layer_interfaces: Sequence[float] | None = None) -> int
Hard resource guard of the solver pipeline (finding 10.06).
Predicts the problem size from the geometry and raises before
anything of that size is allocated. Two sizes are checked against
the engine's limit, engine.max_segments (user decision Q17), or
HARD_LIMIT (read at call time) if the engine leaves it at
None:
- the leakage segments (reaction matrix): first the closed-form lower bound \(\sum_e \lceil L_e/ds \rceil\), then, if that is within the limit, the exact count;
- the unknowns of the dense augmented nodal system (owners, nodes and branches, including every sub-piece and interior node of a conductor chain), in closed form (audit round 2, A2S-02: up to then an isolated conductor of 2000 sub-pieces counted as zero).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
world
|
'World'
|
World to be solved. |
required |
engine
|
'Engine'
|
Engine carrying |
required |
layer_interfaces
|
Sequence[float] | None
|
Interface depths in m at which the backend splits wires. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
The predicted segment count (electrodes plus galvanic conductor segments). |
Raises:
| Type | Description |
|---|---|
ResourceLimitError
|
If either size exceeds the limit. |
Source code in src/groundfield/diagnostics.py
check_segment_resolution ¶
Heuristic discretisation-quality check, one string per cause.
Inspects the world / engine pair for common modelling pitfalls and returns one human-readable string per cause (review finding 10.70: up to 0.15.0 one string per electrode, so a layout with 81 joint rods emitted 81 warnings per solve). The empty list means no concerns detected. Causes:
- Thin-wire ratio (
"thin-wire: ..."). Each electrode must satisfysegment_length >= MIN_THINWIRE_RATIO * wire_radiusso that the thin-wire average-potential self-action remains valid; a distributed conductor'sdiscretize_segment_lengthlikewise. - Electrode feature shorter than one segment
(
"resolution: ..."), using each electrode'smin_feature_length()— every kind, including polyline and star electrodes (F53 / F54, listed as fixed in 0.15.0 but skipped until 2026.11). - Total segment budget (
"budget: ..."): the segment count or the size of the dense nodal system (every conductor sub-piece included) at or above the engine's notice sizeEngine.warn_segments(defaultSOFT_LIMIT), or above the engine's limitEngine.max_segments(defaultHARD_LIMIT; the solve then refuses withResourceLimitError).
The function never raises (except for a non-positive
segment_length) — it only reports. The full report with
proximity and inert-setting checks is diagnose().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
world
|
'World'
|
World to inspect. |
required |
engine
|
'Engine'
|
Engine carrying |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Zero to three diagnostic strings, in the order thin-wire, resolution, budget; each names up to five electrodes or conductors and the number of further ones. |
Source code in src/groundfield/diagnostics.py
diagnose ¶
diagnose(world: 'World', engine: 'Engine | None' = None, *, result: 'FieldResult | None' = None, proximity: bool = True) -> DiagnosticsReport
Aggregated diagnostics of a world (review finding 10.70).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
world
|
'World'
|
World to inspect. |
required |
engine
|
'Engine | None'
|
Engine of the solve. Needed for the discretisation checks
(thin wire, resolution, budget against the engine's limit
|
None
|
result
|
'FieldResult | None'
|
Solved result; adds the post-solve checks (series truncation). |
None
|
proximity
|
bool
|
Run the close / interpenetrating wire check
( |
True
|
Returns:
| Type | Description |
|---|---|
DiagnosticsReport
|
Findings with category, severity, subjects and data; |
Notes
Categories:
coordinates
The world mixes local and projected coordinates: points lie both
within 10 km of the origin and beyond 1000 km from it (horizontal
distance; warning, user decision D5, audit W2B-04). The world is
solved as given, its two groups some 33 000 km apart, and the solve
warns with MixedCoordinatesWarning. A world that does not
mix but whose horizontal extent (the diagonal of its bounding box)
exceeds 100 km is reported as information (two UTM zones, a zone
prefix on some eastings only, a geometry in millimetres). The data
name the elements of each group (near, far), the conductors
between them (spanning, spanning_lengths_m) and the extent
(extent_m, bounds_xy_m).
thin_wire
segment_length / wire_radius below MIN_THINWIRE_RATIO
(electrodes; discretize_segment_length for distributed
conductors).
resolution
An electrode feature shorter than segment_length
(min_feature_length():
rod and strip length, ring circumference, shortest polyline
edge, star arm, mesh span).
budget
Predicted segment count or nodal system at or above the engine's
notice size, Engine.warn_segments or by default
SOFT_LIMIT (info: the solve may take minutes), or above the
engine's limit, Engine.max_segments or by default
HARD_LIMIT (warning: the solve refuses).
report.context["max_segments"] and
report.context["warn_segments"] hold the two sizes.
proximity
Leakage wires of different owners closer than
PROXIMITY_REL_THRESHOLD times the sum of their radii. Two
wires of one generated foundation (<name> and <name>_w<j>,
bonded by <name>_bond_<k>) are reported only away from the
vertices they share: they meet at its corners and crossings by
design (audit D3A-04), but the opposite sides of a narrow encased
ring or the parallel wires of a fine mesh are close wires like any
other (audit R4A-04); findings between foundations name their
anchors:
interpenetrating / close are warnings with the point
kernel and information with the exact line kernel (which
integrates near pairs), crossing / touching (wires that
meet without a bond in the model) are information.
overlap
Two conductors with an inductance_model (insulated or bare) that
lie beside each other closer than touching — axis distance below
the sum of their radii by more than 1e-9 of it, or by more than 16
units in the last place of the largest coordinate of the pair,
whichever is larger (round-off of a drawing at the touching
distance is not an overlap, also at projected coordinates; audits
W3B-03, W3R2B-02) — over more than OVERLAP_REL_LENGTH
times that distance and OVERLAP_FRACTION of the shorter
conductor (warning): a service drop drawn on its PEN main, two
cables on one axis. The inductance matrix evaluates them
as touching wires (since 2026.11), so their coupling over the
stretch follows their radii instead of the drawn spacing. A
thinner conductor inside a "cable_shield" conductor is its
concentric core (user decision Q32) and not reported; conductors
that meet at a point (a crossing, a T-contact, a branch: two drops
leaving a cabinet 1.7 deg apart run within touching for 0.4 m of
their 180 m) are not overlaps (thresholds: comment of
OVERLAP_FRACTION). The data give the length of the
stretch (overlap_m), its ends, the smallest axis distance and
the touching distance.
interface_contact
A rod head or tip within one wire radius of a physical layer
interface, where the thin-wire model (no end face) deviates from
the solid rod by up to +21 % (audit A3S-05), and a horizontal wire
(every electrode but a rod, the leaking pieces of a galvanic
distributed conductor) within the reach of a contrasting interface,
where the thin wire deviates from the solid wire by more than about
1 % (3.9 wire radii over a layer 33 times more conductive; audits
W4A-07, W4B-02, W4R2A-04); the segment backends and the 3-D fem warn with
InterfaceContactWarning too. With an
fem engine there is no such finding for a world that its
axisymmetric model takes (FemOptions.model "auto" or
"axisymmetric"): that model resolves the rod end faces and the
ring wires as the solid bodies they are and its solve does not warn
(audit W4R2A-05).
inert
Settings the solve ignores: conductors not attached at both ends,
the deprecated concrete-shell registry, non-default boundary
conditions, a non-default soil permittivity.
series
After the solve: a backend that reports converged=False.
Source code in src/groundfield/diagnostics.py
1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 | |
expected_segments ¶
expected_segments(world: 'World', engine: 'Engine', *, layer_interfaces: Sequence[float] | None = None) -> dict[str, Any]
Predict the number of point-source segments after discretisation.
Uses the electrodes' own discretisation
(segment_count()
and siblings), so the prediction is exact for the image family,
including the split of wires at the soil-layer interfaces. An
electrode whose closed-form lower bound
\(\lceil L_\text{total}/ds \rceil\) already exceeds the engine's
limit (Engine.max_segments, default HARD_LIMIT) is
counted by that bound instead, so that a unit error does not
allocate a huge discretisation just to count it. The fem backend
(groundfield.solver.fem) solves a volume mesh that is unrelated
to segment_length (FemOptions.max_nodes, max_nodes_3d); for
it the prediction counts only the display segments of its result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
world
|
'World'
|
World to inspect. |
required |
engine
|
'Engine'
|
Engine carrying |
required |
layer_interfaces
|
Sequence[float] | None
|
Interface depths in m at which wires are split. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Keys:
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/groundfield/diagnostics.py
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | |
world_statistics ¶
Return a structural snapshot of a world.
Aggregates counts, lengths and the bounding box; complements
World.summary() (one-line text) with a richer
machine-readable dictionary that scales to production-grade networks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
world
|
'World'
|
World to inspect. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Keys:
|
Source code in src/groundfield/diagnostics.py
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | |