Skip to content

Integrate upstream master while preserving upstream ground API - #12

Merged
andrekuehne merged 4 commits into
masterfrom
integrate/upstream-master-2026-09-27
Sep 27, 2026
Merged

andrekuehne merged 4 commits into
masterfrom
integrate/upstream-master-2026-09-27

Conversation

@andrekuehne

@andrekuehne andrekuehne commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Merge tmolteno/necpp:master at 9b6d00d into this fork, resolving the conflicts with its stateful API. This uses a real merge commit with both master histories as parents, so future upstream updates retain their ancestry. Supersedes #11 with a fork-owned source branch.

Upstream's nec_ground_connection enum, C API implementation, ground validation, added tests, fixture fixes, and changelog text are retained. The geometry conflict adopts upstream's ground-contact logic; simulate() retains the fork's activate_medium_parameters() before upstream's missing-ground-model check. Both sets of geometry tests are preserved.

The fork's stateful C++ enum is renamed to nec_model_ground_connection to avoid the public-header name collision. Native C++ callers using that type must update and rebuild. C/WASM signatures and numeric values are unchanged. Two existing fork test files now compile the C and C++ public headers in opposite orders to guard against another collision.

Validation:

  • Native GCC 15.2 Release build completed.
  • All 8 CTest targets passed, including stateful, ground, symmetry, and CLI smoke coverage (181 Catch2 cases plus the CLI smoke test).
  • C-only public-header compilation and both C++ header include orders passed.
  • GitHub Actions run 36338613540 passed all 11 validation/reporting jobs: native builds, Emscripten rebuild, Node WASM ABI, TypeScript facade, package build, clean consumers, Chromium direct/worker consumers, Firefox pooled fields, and artifact checksums. The tag-only publishing job was correctly skipped.

tmolteno and others added 4 commits September 1, 2026 14:05
The zero-current ground mode (NEC GE -1) was documented but effectively
treated as no ground: build_connections() guarded every plane check with
ignd > 0, so below-plane and in-plane segments were silently accepted
and no ground model was required. Per NEC-2 Part 3, when I1 is nonzero
no segment may extend below the ground plane or lie in it, and the
ground parameters must be specified on a GN card.

- Add nec_ground_connection to the C API: ZERO_CURRENT stays the stable
  public ABI value 2 while the native geometry receives -1.
- Validate both signed ground modes in build_connections(); GE -1 keeps
  the Fortran connection semantics (a ground-touching end stays a free
  end, so current goes to zero there) and the low-horizontal-wire escape
  hatch (only a segment with both ends exactly on the plane is rejected
  as lying in it).
- Fail at simulate() when a non-none connection has no ground model
  instead of silently running free space.
- discone.nec gains the missing GN 1; test_example1 completes the
  geometry with 0, matching its free-space deck.
- Unit tests cover the plane checks for both signed modes, the ABI
  mapping, and the ground-model requirement (closes tmolteno#133).
The zero-current fix makes a non-none ground connection without a GN card
fail at simulate(), so test_example1 (a free-space dipole whose deck
comment shows plain "GE") must complete the geometry with flag 0. Add a
comment so the change is not mistaken for a typo.
…-mode

fix: implement GE -1 zero-current ground mode and signed-mode validation
Retain upstream ground validation, C API enum, tests, and fixture fixes. Resolve geometry and simulation conflicts while preserving fork symmetry and medium initialization. Rename the fork stateful enum to nec_model_ground_connection and compile the C/C++ headers together in both orders.
@andrekuehne
andrekuehne merged commit 51cf9fa into master Sep 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants