Skip to content

Dump the outer-boundary input next to outer.msh - #41

Open
krystophny wants to merge 4 commits into
mainfrom
feat/dump-outer-boundary
Open

Dump the outer-boundary input next to outer.msh#41
krystophny wants to merge 4 commits into
mainfrom
feat/dump-outer-boundary

Conversation

@krystophny

Copy link
Copy Markdown
Member

write_FreeFem_mesh writes the mesh Triangle produces but not the input Triangle was given, so reproducing the annulus meshing problem outside MEPHIT requires a MEPHIT build. That is why both Triangle-replacement experiments so far (#27, #40) were judged on a hand-made circle rather than a real boundary.

This writes outer_boundary.dat next to outer.msh on every meshing run:

npt_inner npt_outer
R_hole Z_hole
R Z                    x (npt_inner + npt_outer)

17 significant digits, so the dump round-trips the double precision input. A shorter format is not neutral: truncating at 16 digits moves the TCFP_hip production case from 2470 to 2472 triangles, because the KiLCA cases sit at R ~ 1.7e5 cm with 0.5 cm edges.

Eleven lines, one extra ~45 kB text file per run, no behaviour change.

What it enabled

Dumps from this branch now drive https://github.com/krystophny/tokamak-annulus-mesh-bench, which runs fortfem's triangle_compat, Delaunay32 and Triangle on the same .msh contract with no MEPHIT build. Measured on real boundaries from data/mephit_g000001.0001_TCFP_hip.in at max_Delta_rad 3.0 / 1.0 / 0.45 cm:

case inner pts fortfem tris Triangle tris fortfem min angle Triangle min angle
coarse 126 366 366 20.122° 20.122°
medium 366 1048 1048 20.152° 20.152°
production 814 2470 2470 20.060° 20.060°

fortfem matches Triangle exactly on all three. Delaunay32 preserves topology and area but, having no Steiner refinement, drops from 2.56° at 126 boundary points to 0.44° at 814 — the 128-point fixture in #40 overstated it by about a factor of six.

Relates to #25.

https://claude.ai/code/session_01ReV3pqLhWXFrM5DsrcSgWL

write_FreeFem_mesh already writes the mesh Triangle produces; it does not
write what Triangle was given. Reconstructing that from outside MEPHIT means
rebuilding MEPHIT, which is the reason every experiment replacing Triangle
so far (#27, #40) was judged on a hand-made circle instead of a real
boundary.

Write npt_inner, npt_outer, the hole marker and the two boundary loops to
outer_boundary.dat, at 17 significant digits so the dump round-trips the
double precision input exactly. A shorter format changes the refinement:
truncating at 16 digits moves the tcfp_hip production case from 2470 to
2472 triangles, because the geometry sits at R ~ 1.7e5 cm.

The dumps from this change now drive
github.com/krystophny/tokamak-annulus-mesh-bench, which compares meshers on
this exact problem without a MEPHIT build.

Claude-Session: https://claude.ai/code/session_01ReV3pqLhWXFrM5DsrcSgWL
@krystophny

Copy link
Copy Markdown
Member Author

Dependency follow-up: this branch now pins libneo bridge 9f1e9dcf5ab6800213415eac485e85a6d395f72a from libneo PR itpplasma/libneo#413, which consumes standalone Fortio 11afd0bd1af0c99ea4e9a1c0df683dbdcc299b69 from Fortio PR lazy-fortran/fortio#68. No system HDF5 link is introduced.

@krystophny

Copy link
Copy Markdown
Member Author

Correction: the compatible main-line libneo bridge is PR itpplasma/libneo#414 at commit 7262c32bf0406594a8ef27e84654d249aef2cb86. This replaces the FortFEM-specific bridge reference; it consumes standalone Fortio PR lazy-fortran/fortio#68. The consumer branch has been updated and CI restarted.

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