NEC Card Support
For version 0.1.0-alpha.4.
NEC Workbench distinguishes three levels of card support:
- Preserved — source text survives opening, editing, saving, and run-snapshot archiving.
- Understood — Workbench identifies the card, assigns it to the correct NEC section, validates fixed integer/numeric field types, and exposes existing fields through a generic fixed-field table in the Other card table.
- Structured Editable — a dedicated editor provides card-specific labels, choices, validation, or model behavior.
Every standard NEC-2 mnemonic is recognized. Unknown solver extensions are still preserved exactly and remain editable in Raw Source.
See NEC Validation Reference for backend profiles, severity, card-level checks, control-sequence rules, and the imported-deck audit.
Support level does not imply graphical rendering or parsed result support. Those are listed separately where applicable. Solver acceptance remains authoritative for backend-specific options.
Geometry Cards
| Card | Purpose | Support | Graphical geometry |
|---|---|---|---|
GW |
Wire | Structured Editable | Yes |
GC |
Tapered wire radius | Understood | Yes, as a tapered GW path |
GA |
Wire arc | Structured Editable | Yes |
GH |
Helix or spiral | Structured Editable | Yes for helices; flat spirals preserved but not rendered (their segments still count in NEC numbering, and Model Check warns that many solvers handle them unreliably) |
SP |
Surface patch | Structured Editable | Yes |
SM |
Multiple-patch surface | Structured Editable | Yes, expanded into grid cells |
SC |
Patch continuation | Structured Editable | Yes, with its parent SP/SM |
GM |
Move or replicate structure | Understood | Yes, in authored order |
GX |
Reflect structure | Understood | Yes, including combined reflection planes |
GR |
Generate cylindrical structure | Understood | Yes, around the Z axis |
GS |
Scale structure | Structured Editable | Applied in source order to wire and surface geometry |
GF |
Read Numerical Green's Function | Understood | No; backend-dependent |
GE |
End geometry | Structured Editable | Boundary understood |
The solver receives the authored geometry values unchanged. Workbench
expands GA, helical GH,
GW/GC taper combinations, and ordered
GM/GX/GR transformations into
semantic paths for selection, fitting, attachment markers, and 2D/3D
display. Generated or transformed paths are read-only so graphical
editing cannot silently replace their source operations. SP
arbitrary and shaped patches, SM patch grids, and their
SC continuations remain separate surface primitives and
appear as translucent polygons in 2D, 3D, and radiation antenna
overlays. Patch geometry is currently read-only outside Raw Source and
the card tables.
Program Control Cards
| Card | Purpose | Support |
|---|---|---|
EK |
Extended thin-wire kernel | Understood |
FR |
Frequency | Structured Editable |
GN |
Ground | Structured Editable |
KH |
Interaction approximation range | Understood |
LD |
Structure loading | Structured Editable |
EX |
Excitation | Structured Editable for voltage sources |
NT |
Two-port network | Structured Editable (Networks card table in the properties pane;
drawn and selectable in Geometry; ports validated, linted, and remapped
like TL ends) |
TL |
Transmission line | Structured Editable |
CP |
Coupling calculation | Understood |
EN |
End data | Understood |
GD |
Additional ground parameters | Understood |
NE |
Near electric field request | Understood |
NH |
Near magnetic field request | Understood |
NX |
Next structure | Understood |
PQ |
Charge-density print control | Understood |
PT |
Current print control | Understood |
RP |
Radiation pattern | Structured Editable |
WG |
Write Numerical Green's Function | Understood; backend-dependent |
XQ |
Execute | Structured Editable |
Workbench and Compatibility Cards
| Card | Purpose | Support |
|---|---|---|
SY |
Workbench parameter/expression | Structured Editable |
Z0 |
Workbench/xnec2c reference impedance | Structured Editable |
ZO |
Legacy spelling of reference impedance | Structured Editable |
CM, CE |
Comments and comment boundary | Understood; Raw Source editing |
' |
4nec2 comment, anywhere on a line | Understood; kept in the authored deck, removed from solver decks |
' necwb:at=P% |
Workbench position of an EX voltage source along its
wire |
Structured Editable (Sources table) |
NT and TL cards follow NEC-2's group rule
(NEC-2 User's Guide, Part III, NT and TL card notes; nec2c
main.c): the first NT or TL card
after any other card except PT discards every earlier
network and transmission line. A segment of -1 (field I2)
on that first card only clears; anywhere else in a group NEC-2 stops
with a data error, which Model Check reports. Workbench records which
group each line and network belongs to.
SY, Z0, and ZO are normalized
or removed as appropriate when Workbench creates a numeric deck for a
strict NEC-2 backend. The authored source and archived source snapshot
retain them.
An expression in a NEC integer field (the leading integer fields of
each card: tags, segment counts, segment numbers, counts and type codes)
must resolve to a whole number, within 1e-9 of its value for rounding
error (never more than 1e-5, so a real fraction such as
1000000000.5 is refused at any size), and fit a 32-bit
integer; otherwise the deck does not resolve and cannot be solved.
Values are never rounded.
4nec2 starts a comment with ' anywhere in a deck (4nec2
help, "Notepad- and Nec-edit"). Workbench reads fields up to it and
keeps the comment text. It uses one such comment as an extension:
EX 0 1 11 0 1 0 ' necwb:at=50% places a type 0 or 5 voltage
source at 50% of its wire's length from End 1. Each resolution puts the
source on the segment containing that point, and on a joint between two
segments on the one nearer End 1. The segment field is rewritten to
match with each Workbench edit, so programs that ignore the comment
still read the segment Workbench uses. The position is refused for tag
0, a tag carried by several wires, a flat spiral, and other
EX types. See the User Guide.
For direct 4nec2 NEC2dXS execution, Workbench
additionally rewrites recognized numeric cards in the generated
model.nec with single-space field separators. NEC2dXS
inherits the NEC-2 free-field convention of recognizing spaces and
commas, but not tab characters; without this backend-only normalization,
a tabbed card can fail with an invalid integer field error. Numeric
field text is retained rather than rounded into narrower display
columns. NEC2C and OpenNEC solver copies are not reformatted by this
compatibility step.