From f84dcf12d46f323d8bf624b571999e1ca38d3727 Mon Sep 17 00:00:00 2001 From: Stephan Kramer Date: Tue, 24 Mar 2026 14:05:35 +0000 Subject: [PATCH 1/3] Try CI with current gmsh version --- docker/Dockerfile.noble | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.noble b/docker/Dockerfile.noble index 241843554e..f6233c3541 100644 --- a/docker/Dockerfile.noble +++ b/docker/Dockerfile.noble @@ -23,8 +23,9 @@ RUN apt-get update && \ apt-get clean # Use old version of gmsh in CI to avoid mesh-sensitive tests failing -WORKDIR /usr/local -RUN curl -fsL https://gmsh.info/bin/Linux/gmsh-2.16.0-Linux64.tgz | tar --strip-components=1 -zxf - +# WORKDIR /usr/local +# RUN curl -fsL https://gmsh.info/bin/Linux/gmsh-2.16.0-Linux64.tgz | tar --strip-components=1 -zxf - +gmsh --version ENV OMPI_MCA_btl_vader_single_copy_mechanism=none ENV OMPI_MCA_rmaps_base_oversubscribe=1 From c982e1e372352bfdee4b95736d51e9650dbce533 Mon Sep 17 00:00:00 2001 From: Stephan Kramer Date: Wed, 25 Mar 2026 13:57:06 +0000 Subject: [PATCH 2/3] Actually use a base image rebuilt with gmsh 4 --- docker/Dockerfile.noble | 3 ++- docker/actions/Dockerfile.actions.noble | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.noble b/docker/Dockerfile.noble index f6233c3541..21c138bbb7 100644 --- a/docker/Dockerfile.noble +++ b/docker/Dockerfile.noble @@ -20,12 +20,13 @@ RUN apt-get update && \ echo "Europe/London" > /etc/timezone && \ apt-get -y install fluidity-dev texlive-pstricks texlive texlive-latex-extra texlive-science python3-pip python3-junit.xml && \ apt-get -y install sudo flex bison && \ + apt-get -y install gmsh && \ apt-get clean # Use old version of gmsh in CI to avoid mesh-sensitive tests failing # WORKDIR /usr/local # RUN curl -fsL https://gmsh.info/bin/Linux/gmsh-2.16.0-Linux64.tgz | tar --strip-components=1 -zxf - -gmsh --version +RUN gmsh --version ENV OMPI_MCA_btl_vader_single_copy_mechanism=none ENV OMPI_MCA_rmaps_base_oversubscribe=1 diff --git a/docker/actions/Dockerfile.actions.noble b/docker/actions/Dockerfile.actions.noble index 08d68cdde4..9bce214c3c 100644 --- a/docker/actions/Dockerfile.actions.noble +++ b/docker/actions/Dockerfile.actions.noble @@ -1,4 +1,4 @@ -FROM fluidity/baseimages:noble +FROM fluidity/baseimages:noble-gmsh4 USER root From 680a39602d9cd8b8bea7d03560a6dd2821b1010d Mon Sep 17 00:00:00 2001 From: Stephan Kramer Date: Thu, 26 Mar 2026 14:11:32 +0000 Subject: [PATCH 3/3] Add warnings for reading gmsh v4 in python This does not correctly read in physical surface ids, and so a tool like transform_mesh with a msh4 input mesh will end up writing out (in msh2 format) with random physical ids. So this probably means we just need to stick with msh2 for a small number of tests that use these python tools. --- python/fluidity/diagnostics/gmshtools.py | 14 ++++++++++++++ tests/channel_wind_drag_rotated/Makefile | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/python/fluidity/diagnostics/gmshtools.py b/python/fluidity/diagnostics/gmshtools.py index 371bf2a78c..6fc0720b36 100644 --- a/python/fluidity/diagnostics/gmshtools.py +++ b/python/fluidity/diagnostics/gmshtools.py @@ -290,6 +290,9 @@ def ReadBinaryMshV2(fileHandle, dataSize): def ReadBinaryMshV4(fileHandle, dataSize): + raise Warning("Fluidity's gmshtools does not correctly read physical surface ids " + "for meshes in .msh format version 4. If these are required save your .msh-file" + "in .msh format version 2 (e.g. using -format msh2 on the command line).") if dataSize == 4: sizeFormat = "i" elif dataSize == 8: @@ -410,6 +413,10 @@ def ReadBinaryMshV4(fileHandle, dataSize): if swap: sArr.byteswap() + # NOTE: these are not the physical and elementary tags + # that are expected in msh2 format. Physical tags + # can only be found by also reading in the separate + # "Entities" section ids = [entityTag, sArr[0]] nodes = FromGmshNodeOrder(utils.OffsetList(sArr[1:], -1), type) element = elements.Element(nodes, ids) @@ -519,6 +526,9 @@ def ReadAsciiMshV2(fileHandle): def ReadAsciiMshV4(fileHandle): + raise Warning("Fluidity's gmshtools does not correctly read physical surface ids " + "for meshes in .msh format version 4. If these are required save your .msh-file" + "in .msh format version 2 (e.g. using -format msh2 on the command line).") line = ReadNonCommentLine(fileHandle) assert line == "$EndMeshFormat" @@ -594,6 +604,10 @@ def ReadAsciiMshV4(fileHandle): lineSplit = line.split() assert len(lineSplit) == 1 + type.GetNodeCount() + # NOTE: these are not the physical and elementary tags + # that are expected in msh2 format. Physical tags + # can only be found by also reading in the separate + # "Entities" section ids = [entityTag, int(lineSplit[0])] nodes = FromGmshNodeOrder([int(node) - 1 for node in lineSplit[1:]], type) element = elements.Element(nodes, ids) diff --git a/tests/channel_wind_drag_rotated/Makefile b/tests/channel_wind_drag_rotated/Makefile index 4d643b8f3e..2f76f15e9d 100644 --- a/tests/channel_wind_drag_rotated/Makefile +++ b/tests/channel_wind_drag_rotated/Makefile @@ -1,7 +1,7 @@ PROJECT = channel input: clean - gmsh -3 -o channel.msh src/channel.geo + gmsh -3 -format msh 2 -o channel.msh src/channel.geo ../../bin/transform_mesh '(cos(1.)*x-sin(1.0)*y,sin(1.)*x+cos(1.)*y,z)' channel