Default the bend actual field from g_ref#73
Merged
Conversation
Implements Kn0_from_g_ref (bend.md), the behavior that replaced the retired g_actual/bend_field_actual pair: unless the author says otherwise, a bend bends its own reference particle along the reference curve, so Kn0 = g_ref and Bn0 = Bn0_ref. The seeded component is completed into all four forms by the multipole resolver that runs next. Any of Kn0, Kn0L, Bn0 or Bn0L already given stands the default down -- the integrated forms state the same field over the length -- as does Kn0_from_g_ref: false, and a straight bend has no field to copy. A curved bend carrying no MagneticMultipoleP gets one created for the field to live in, a third exception to leaving absent groups untouched after the parser-added ReferenceP and FloorP. Kn0_from_g_ref itself joins the non-false group defaults. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
Kn0_from_g_refdefaulting ofbend.md, the behavior that replaced theg_actual/bend_field_actualpair retired in #72.Unless the author says otherwise, a bend bends its own reference particle along the reference curve, so the actual bending field is the reference one:
Kn0=g_ref(equivalentlyBn0=Bn0_ref).resolve_bend_actual_fieldruns between the bend and multipole resolvers, seeding the dipole component thatresolve_magnetic_multipolesthen completes into all four forms.The default stands down whenever the author has stated the field: any of
Kn0,Kn0L,Bn0,Bn0Lcounts, since the integrated forms say the same thing over the length. A skew dipole does not — that is a different component.Kn0_from_g_ref: falsedeclines the default outright, and a straight bend has no reference field to copy, so nothing is written and no group appears.Two notes on where things land:
MagneticMultipolePis created on a curved bend that carries none. That is a third exception to "an absent group is left untouched", after the parser-addedReferencePandFloorP; without it the default would be unobservable, since the common bend writes no multipole group at all. The comment onkGroupDefaultsand the "leaves absent parameter groups alone" test both now say so.Kn0_from_g_ref: truejoinskGroupDefaults, a non-false default of a group the element already carries, alongsideref_geometry: ARC.Six new bookkeeper tests: the default itself, the
falsesetting, an author-setKn0kept as-is,Kn0Lcounting as set, the field joining a group of other orders, and the straight bend. 174 tests pass.🤖 Generated with Claude Code