From d503a15e15495f58641ef65a080b3dabfa57bdd6 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Thu, 20 Aug 2026 09:23:50 +0200 Subject: [PATCH 1/4] Dump the outer-boundary input next to outer.msh 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 --- src/mephit_mesh.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mephit_mesh.F90 b/src/mephit_mesh.F90 index 152e31e..096a628 100644 --- a/src/mephit_mesh.F90 +++ b/src/mephit_mesh.F90 @@ -3108,6 +3108,17 @@ subroutine write_FreeFem_mesh theta(:) = linspace(0d0, 2d0 * pi, npt_outer, 0, 1) bdry_R(npt_inner+1:) = R_mid + R_rad * cos(theta) bdry_Z(npt_inner+1:) = Z_mid + Z_rad * sin(theta) + ! dump the triangulator input so the annulus meshing problem can be + ! reproduced without a MEPHIT build, e.g. for mesher comparisons + open(newunit = fid, file = decorate_filename('outer_boundary.dat', '', basename_suffix), & + status = 'replace', form = 'formatted', action = 'write') + write (fid, '(2(1x, i0))') npt_inner, npt_outer + ! 17 significant digits so the dump round-trips the double precision input + write (fid, '(2(1x, es24.16e3))') R_mid, Z_mid + do kpoi = 1, npt_inner + npt_outer + write (fid, '(2(1x, es24.16e3))') bdry_R(kpoi), bdry_Z(kpoi) + end do + close(fid) call FEM_triangulate_external(npt_inner, npt_outer, bdry_R, bdry_Z, R_mid, Z_mid, & decorate_filename('outer.msh', '', basename_suffix) // c_null_char) deallocate(bdry_R, bdry_Z, theta) From f67f4ff68d0a5032d8a2b49c7c8dd02a1fb0b494 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Tue, 25 Aug 2026 15:12:45 +0200 Subject: [PATCH 2/4] build: pin libneo Fortio 0.2.0 --- cmake/SetupCODE.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SetupCODE.cmake b/cmake/SetupCODE.cmake index 8143645..3fc10c8 100644 --- a/cmake/SetupCODE.cmake +++ b/cmake/SetupCODE.cmake @@ -5,6 +5,6 @@ # -DLIBNEO_PATH= local libneo source directory (empty = fetch from git) # -DTRIANGLE_DIR= prebuilt Triangle directory (see SetupTriangle) # -DMFEM_DIR= prebuilt MFEM directory (see SetupMFEM) -set(LIBNEO_REF "a4620f8075698dabafd774859e28e0ae92e8f339" CACHE STRING +set(LIBNEO_REF "055ec9aa7c0e80228d393fdc6e4e2a99235e5973" CACHE STRING "libneo branch, tag, or SHA to fetch") set(LIBNEO_PATH "" CACHE PATH "local libneo source directory (empty = fetch from git)") From 65d984aeb48851762bcf7946069c674d6ecf1737 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Tue, 25 Aug 2026 16:51:14 +0200 Subject: [PATCH 3/4] build: track Fortio lifecycle bridge --- cmake/SetupCODE.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SetupCODE.cmake b/cmake/SetupCODE.cmake index 3fc10c8..3ae890a 100644 --- a/cmake/SetupCODE.cmake +++ b/cmake/SetupCODE.cmake @@ -5,6 +5,6 @@ # -DLIBNEO_PATH= local libneo source directory (empty = fetch from git) # -DTRIANGLE_DIR= prebuilt Triangle directory (see SetupTriangle) # -DMFEM_DIR= prebuilt MFEM directory (see SetupMFEM) -set(LIBNEO_REF "055ec9aa7c0e80228d393fdc6e4e2a99235e5973" CACHE STRING +set(LIBNEO_REF "9f1e9dcf5ab6800213415eac485e85a6d395f72a" CACHE STRING "libneo branch, tag, or SHA to fetch") set(LIBNEO_PATH "" CACHE PATH "local libneo source directory (empty = fetch from git)") From 4982f727069099778fbdb01d266be72a805bb36a Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Tue, 25 Aug 2026 17:36:19 +0200 Subject: [PATCH 4/4] build: use main-line libneo lifecycle bridge --- cmake/SetupCODE.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SetupCODE.cmake b/cmake/SetupCODE.cmake index 3ae890a..c63518a 100644 --- a/cmake/SetupCODE.cmake +++ b/cmake/SetupCODE.cmake @@ -5,6 +5,6 @@ # -DLIBNEO_PATH= local libneo source directory (empty = fetch from git) # -DTRIANGLE_DIR= prebuilt Triangle directory (see SetupTriangle) # -DMFEM_DIR= prebuilt MFEM directory (see SetupMFEM) -set(LIBNEO_REF "9f1e9dcf5ab6800213415eac485e85a6d395f72a" CACHE STRING +set(LIBNEO_REF "7262c32bf0406594a8ef27e84654d249aef2cb86" CACHE STRING "libneo branch, tag, or SHA to fetch") set(LIBNEO_PATH "" CACHE PATH "local libneo source directory (empty = fetch from git)")