Skip to content

RDCON, DCON - BUGFIX - Taylor-slot typos in sing_mmat (F 6th order in slot 6, DCON G 3rd order from G''') - #304

Merged
matt-pharr merged 1 commit into
developfrom
pr_sing_order_typo
Oct 15, 2026
Merged

matt-pharr merged 1 commit into
developfrom
pr_sing_order_typo

Conversation

@StuartBenjamin

@StuartBenjamin StuartBenjamin commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Two slot typos in the Taylor series that sing_mmat builds at each rational surface:

  1. F, 6th order (RDCON sing.f and sing1.f, DCON sing.f): the 6th-order term was written into slot 5, overwriting the 5th order and leaving the 6th at zero.
  2. G, 3rd order (DCON sing.f): gmats%f2/6 instead of gmats%f3/6, which RDCON and STRIDE use.

Who is affected: RDCON whenever the series order is 6 or more. With the default sing_order_ceiling = t that includes sing_order = 5 wherever Re α > 0; the shipped examples use 6 and tearing-physics-suite uses 8. DCON only with sing_order ≥ 3 (the default is 2, which is unchanged).

Tests

develop 1055d1b vs this branch:

case develop this PR
DCON DIIID_ideal, sing_order 3 and 6 W eigenvalues change ≤ 7e-10
RDCON a5_tearing_example (sing_order 6), Δ′(2/1) 13.0445 13.1876
RDCON D3D-like i-file, sing_order 8: Δ′ 2/1, 3/1, 4/1 8.3256, −3.8994, −17.927 8.3237, −3.8944, −17.759

On develop these RDCON shifts are inflated by the Galerkin inconsistency fixed in #303. In a separate build that includes the #303 fix (D3D i-file, mpsi 1024), this fix moves 3/1 Δ′ only from −3.987 to −3.992.

Scripts: sing_order_typo_scripts.zip, run PY_NC=python3 ./run_tests.sh DEV/bin PR/bin $GPECHOME/docs/examples out.


🤖 Generated with Claude Code

… slot 6, DCON G 3rd order from G''')

sing_mmat (rdcon/sing.f, dcon/sing.f) and sing1_mmat (rdcon/sing1.f)
wrote the 6th derivative term of Q*Lbar (20*Q'''*Lbar''') into
f(:,:,5), overwriting the 5th-order term and leaving the 6th zero,
whenever the series order is >= 6 (in RDCON with sing_order_ceiling,
the default, that is sing_order + ceil(2 Re alpha)). The K term and
stride/sing.F already use slot 6.

dcon/sing.f also set the 3rd-order G term from gmats%f2/6 instead of
gmats%f3/6 whenever sing_order >= 3. RDCON (sing_mmat, sing1_mmat) and
STRIDE use f3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@matt-pharr matt-pharr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, FTR I did confirm that this bug was not present in julia.

@matt-pharr
matt-pharr merged commit d7437e0 into develop Oct 15, 2026
6 checks passed
@matt-pharr
matt-pharr deleted the pr_sing_order_typo branch October 15, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants