Skip to content

magnetics! on an IDS without data; mesher_heat_flux: levels as a vector, midplane point, closing abscissa - #328

Merged
tomneiser merged 5 commits into
masterfrom
fix/magnetics-wall-mesh
Nov 16, 2026
Merged

tomneiser merged 5 commits into
masterfrom
fix/magnetics-wall-mesh

Conversation

@tomneiser

Copy link
Copy Markdown
Member

Fixes in magnetics! and in the wall mesh of the heat fluxes, one commit each.

  1. magnetics!: IDS without data. AbstractTrees.Leaves of an IDS without data yields the IDS itself, which has no field, so magnetics!(mag, eq) raised type magnetics has no field field on a dd without magnetics data (FUSE's ActorMagnetics on a machine without probes) instead of doing nothing. Only field leaves are looked at now, as in time_groups and time_dependent_leaves.
  2. mesher_heat_flux: psi levels given as a vector.
    • with levels a vector and merge_wall = true (the default) the function raised UndefVarError: eqt2d: the 2D equilibrium was looked up only in the branch that builds the levels from a number;
    • the first level is set to the separatrix, and this was written into the caller's vector.
  3. mesher_heat_flux: outer midplane point. (r_wall_midplane, Z0) in (Rwall, Zwall) looks for the pair among the two vectors, so it was always false and the point was always prepended, also when the mesh already has it.
  4. mesher_heat_flux: abscissa of the closing point. The closing point was appended to the mesh before the length of the closing segment was computed, from the first and the (new) last point, so the last segment had zero length in s.

Effect

On the dds of FUSE.init for ITER (from scalars), D3D and FPP:

v7.5.0 this branch
magnetics!, ITER and FPP (no magnetics data) throws runs, nothing to do
magnetics!, D3D (76 probes, 44 flux loops) identical
mesher_heat_flux(dd; levels=<vector>) UndefVarError runs; with the levels of the default mesh, the same mesh
mesher_heat_flux(dd), merge_wall true and false: Rwall, Zwall identical
particle and core radiation heat fluxes on these meshes identical
s[end] equal to s[end-1] plus the closing segment (ITER: 21.842 → 21.928 m; without the wall 18.18 → 21.48 m)

None of the three meshes holds the outer midplane point before it is added, so fix 3 changes nothing there. s is used by the plot recipes of the heat flux (the abscissa of the 1D plots).

Tests

  • runtests_interpolations.jl, magnetics!: a second call replaces the synthetic data; an IDS without data stays empty.
  • runtests_smoke.jl, thermal_loads.jl: the mesh is closed and its last abscissa includes the closing segment; the outer midplane point is in the mesh once; levels given as a vector (with and without the wall) give the mesh they were taken from and are not changed.

runtests_smoke.jl, runtests_interpolations.jl and runtests_fluxsurfaces.jl pass locally.

🤖 Generated with Claude Code

tomneiser and others added 5 commits November 16, 2026 05:37
`AbstractTrees.Leaves` of an IDS without data yields the IDS itself (as it does for an empty element of
an array of structures), which has no `field`: `magnetics!(mag, eq)` raised
`type magnetics has no field field` on a dd without magnetics data instead of doing nothing.
Only field leaves are looked at now, as in `time_groups` and `time_dependent_leaves`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- With `levels` a vector and `merge_wall = true` (the default) the function raised
  `UndefVarError: eqt2d`: the 2D equilibrium was looked up only in the branch that builds the levels
  from a number.
- The first level is set to the separatrix; this was written into the caller's vector.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he mesh

`(r_wall_midplane, Z0) in (Rwall, Zwall)` looks for the pair among the two vectors, so it was always
false and the point was always prepended: when the mesh already has that point it was there twice.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The closing point was appended to the mesh before the length of the closing segment was computed,
from the first and the (new) last point: the segment had zero length in `s`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tomneiser
tomneiser merged commit 470b626 into master Nov 16, 2026
2 checks passed
@tomneiser
tomneiser deleted the fix/magnetics-wall-mesh branch November 16, 2026 21:58
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.

1 participant