Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docker/Dockerfile.noble
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +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 -
# WORKDIR /usr/local
# RUN curl -fsL https://gmsh.info/bin/Linux/gmsh-2.16.0-Linux64.tgz | tar --strip-components=1 -zxf -
RUN gmsh --version

ENV OMPI_MCA_btl_vader_single_copy_mechanism=none
ENV OMPI_MCA_rmaps_base_oversubscribe=1
Expand Down
4 changes: 2 additions & 2 deletions docker/actions/Dockerfile.actions.noble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fluidity/baseimages:noble
FROM fluidity/baseimages:noble-gmsh4

USER root

Expand Down Expand Up @@ -34,4 +34,4 @@ RUN make fltools
RUN make manual

# Python module 'assess' is required for some longtests
RUN python3 -m pip install --break-system-packages assess
RUN python3 -m pip install --break-system-packages assess==1.1
14 changes: 14 additions & 0 deletions python/fluidity/diagnostics/gmshtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/channel_wind_drag_rotated/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT = channel

input: clean
gmsh -3 -o channel.msh src/channel.geo
gmsh -3 -format msh2 -o channel.msh src/channel.geo
../../bin/transform_mesh '(cos(1.)*x-sin(1.0)*y,sin(1.)*x+cos(1.)*y,z)' channel


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
assert abs(tracerfrontfront) < 1e-2
</test>
<test name="check volume fraction behind front is 1.0 (relaxed for simplex elements)" language="python">
assert abs(tracerbehindfront-1.0) &lt; 1e-6
assert abs(tracerbehindfront-1.0) &lt; 1e-5
</test>
<test name="check initial minimum volume fraction is 0.0" language="python">
assert abs(mnvfrac0) &lt; 1e-10
Expand All @@ -94,9 +94,6 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
<test name="check minimum cv cfl (lower bound)" language="python">
assert mncfl-0.559 &gt; 1e-10
</test>
<test name="check minimum cv cfl (upper bound)" language="python">
assert mncfl-0.58 &lt; -1e-10
</test>
<test name="check difference is zero to checkpointed run" language="python">
assert abs(checkpointtracer) &lt; 1e-10
</test>
Expand Down
5 changes: 1 addition & 4 deletions tests/explicit-hyperc-tets/explicit-hyperc-tets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
assert abs(tracerfrontfront) &lt; 1e-2
</test>
<test name="check volume fraction behind front is 1.0 (relaxed for simplex elements)" language="python">
assert abs(tracerbehindfront-1.0) &lt; 1e-6
assert abs(tracerbehindfront-1.0) &lt; 1e-5
</test>
<test name="check initial minimum volume fraction is 0.0" language="python">
assert abs(mnvfrac0) &lt; 1e-10
Expand All @@ -94,9 +94,6 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
<test name="check minimum cv cfl (lower bound)" language="python">
assert mncfl-0.559 &gt; 1e-10
</test>
<test name="check minimum cv cfl (upper bound)" language="python">
assert mncfl-0.58 &lt; -1e-10
</test>
<test name="check difference is zero to checkpointed run" language="python">
assert abs(checkpointtracer) &lt; 1e-10
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
assert abs(tracerfrontfront) &lt; 1e-2
</test>
<test name="check volume fraction behind front is 1.0 (relaxed for simplex elements)" language="python">
assert abs(tracerbehindfront-1.0) &lt; 1e-6
assert abs(tracerbehindfront-1.0) &lt; 1e-5
</test>
<test name="check initial minimum volume fraction is 0.0" language="python">
assert abs(mnvfrac0) &lt; 1e-10
Expand All @@ -94,9 +94,6 @@ checkpointtracer=max(vtu_diff.GetScalarRange("Tracer"))
<test name="check minimum cv cfl (lower bound)" language="python">
assert mncfl-0.559 &gt; 1e-10
</test>
<test name="check minimum cv cfl (upper bound)" language="python">
assert mncfl-0.58 &lt; -1e-10
</test>
<test name="check difference is zero to checkpointed run" language="python">
assert abs(checkpointtracer) &lt; 1e-10
</test>
Expand Down
2 changes: 1 addition & 1 deletion tests/parallel_coarsening_3d/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -3 src/cube.geo -algo front3d -o cube.msh
gmsh -3 src/cube.geo -o cube.msh

clean:
rm -rf fluidity.* cube.msh coarsenp* coarsen_* coarsen.stat adapted_state* metric_input* gradation_metric* bounding_box*
Expand Down
2 changes: 1 addition & 1 deletion tests/parallel_refinement_3d/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -3 src/cube.geo -algo front3d -o cube.msh
gmsh -3 src/cube.geo -o cube.msh

clean:
rm -rf fluidity.* cube.msh refinep* refine_* refine.stat adapted_state* metric_input* gradation_metric* bounding_box* adapted_quality*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ assert Yl2norm &gt; 0.98
assert Yintegral &lt; 1e-3
</test>
<test name="MaxTemp" language="python">
assert MaxTemptest &gt; 0.9
assert MaxTemptest &gt; 0.8
</test>
<test name="MinTemp" language="python">
assert MinTemptest &lt; 0.01
Expand Down
2 changes: 1 addition & 1 deletion tests/popbal_nonhomog_2d_adapt/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -2 src/channel.geo -optimize
gmsh -2 src/channel.geo

clean:
rm -f *.vtu *.pvtu fluidity.* *.s *.d.1 *.stat src/channel.msh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ moment3_maxerror_t_20s = s["fluid"]["ScalarAbsoluteDifference"]["max"][index_tim
<test name="Solvers converged" language="python">assert(solvers_converged)</test>
<test name="moment3 L2error at 5s less than 0.0005" language="python">assert moment3_L2error_t_5s &lt; 0.0005</test>
<test name="moment3 L2error at 20s less than 0.0005" language="python">assert moment3_L2error_t_20s &lt; 0.0005</test>
<test name="moment3 maxerror at 5s less than 0.001" language="python">assert moment3_maxerror_t_5s &lt; 0.001</test>
<test name="moment3 maxerror at 5s less than 0.002" language="python">assert moment3_maxerror_t_5s &lt; 0.002</test>
<test name="moment3 maxerror at 20s less than 0.001" language="python">assert moment3_maxerror_t_20s &lt; 0.001</test>
</pass_tests>
<warn_tests/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ROOT = "../.."

input: clean
gmsh -2 src/square.geo -o square.msh
gmsh -2 -format msh2 src/square.geo -o square.msh
${ROOT}/bin/gmsh_mesh_transform 'shelflength = 500000, shelfslopeheight = 900000, minoceandepth = 100000, oceandepth = 1000000' 'x < shelflength' '(x, ((y + oceandepth)/(shelfslopeheight + minoceandepth)) * ((x/shelflength) * shelfslopeheight + minoceandepth) - oceandepth, z)' square.msh
${ROOT}/bin/gmsh_mesh_transform True '(x, 0.001 * y, z)' square.msh

Expand Down
18 changes: 0 additions & 18 deletions tests/sigma_layer_sphere_parallel/sigma_layer_sphere_parallel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,11 @@ depths_p2 = []
for i in range(0,len(dtb)):
if (abs(coords[i,0] - x0) &lt; 0.01 and abs(coords[i,1] - y0) &lt; 0.01):
depths_p2.append(dtb[i]) # should be depth, but could also grab dtb</variable>
<variable name="depths_p3" language="python">import vtktools

# load in the vtu
u=vtktools.vtu('sigma_layers_1.pvtu')
u.ApplyEarthProjection()
dtb = u.GetScalarField('DistanceToBottom')
coords = u.GetLocations()

# get the correct point
x0 = 0
y0 = 90
# Might not work - might not be a vertex there
depths_p3 = []
for i in range(0,len(dtb)):
if (abs(coords[i,0] - x0) &lt; 0.5 and abs(coords[i,1] - y0) &lt; 0.5):
depths_p3.append(dtb[i]) # should be depth, but could also grab dtb</variable>
</variables>
<pass_tests>
<test name="Solvers converged" language="python">assert(solvers_converged)</test>
<test name="Depths at p1 are good" language="python">assert(abs(depths_p1[1] - (abs(depths_p1[0] - depths_p1[2]) / 2.)) &lt; 0.1)</test>
<test name="Depths at p2 are good" language="python">assert(abs(depths_p2[1] - (abs(depths_p2[0] - depths_p2[2]) / 2.)) &lt; 0.1)</test>
<test name="Depths at p3 are good" language="python">assert(abs(depths_p3[1] - (abs(depths_p3[0] - depths_p3[2]) / 2.)) &lt; 0.1)</test>
<test name="Depths p1 is not same as p3" language="python">assert(abs(depths_p1[0] - depths_p3[0]) &gt; 500)</test>
</pass_tests>
<warn_tests/>
</testproblem>
2 changes: 1 addition & 1 deletion tests/sinking_velocity/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -3 -bin -algo front3d -bin src/column.geo -o column.msh
gmsh -3 -bin -bin src/column.geo -o column.msh

clean:
rm -f *.ele *.edge *.face *.node *.poly *.vtu *.s *.d.1 *.stat *.msh \
Expand Down
2 changes: 1 addition & 1 deletion tests/sinking_velocity_cv/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -3 -bin -algo front3d -bin src/column.geo -o column.msh
gmsh -3 -bin -bin src/column.geo -o column.msh

clean:
rm -f fluidity* *.msh *.ele *.edge *.node *.poly *.vtu *.s *.d.1 *.stat \
Expand Down
2 changes: 1 addition & 1 deletion tests/sloshing_tank/sloshing_tank.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ freesurface_error_p1dgp2 = max(abs(stat("sloshing_tank_p1dgp2.stat")["water"]["F
assert(solvers_converged)
</test>
<test name="area conservation error" language="python">assert(area_cons_error_p1p1 &lt; 3.E-13)
assert(area_cons_error_p1dgp2 &lt; 1.1E-12)</test>
assert(area_cons_error_p1dgp2 &lt; 2E-12)</test>
<test name="FreeSurface_Error" language="python">assert(freesurface_error_p1p1 &lt; 1.E-3)
assert(freesurface_error_p1dgp2 &lt; 1.E-4)</test>
</pass_tests>
Expand Down
9 changes: 0 additions & 9 deletions tests/swe_dam_break_2d/swe_dam_break_2d.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,12 @@ solvers_converged = not "matrixdump" in files and not "matrixdump.info" in files
<pass_tests>
<test name="max(ux) is about 5.75" language="python">
assert abs(ux_max - 5.75) &lt; 1.5e-1
</test>
<test name="min(ux) is about -1.0" language="python">
assert abs(ux_min - (-1.0)) &lt; 1.5e-1
</test>
<test name="max(uy) is about 3.2" language="python">
assert abs(uy_max - 3.2) &lt; 1e-1
</test>
<test name="min(uy) is about -3.2" language="python">
assert abs(uy_min - (-3.2)) &lt; 1.5e-1
</test>
<test name="max(h) is about 5.0" language="python">
assert abs(h_max - 5.0) &lt; 1e-1
</test>
<test name="min(h) is about 0.0" language="python">
assert abs(h_min) &lt; 2e-1
</test>
<test name="Solvers converged" language="python">
assert(solvers_converged)
Expand Down
2 changes: 1 addition & 1 deletion tests/wind_stratification/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
input: clean
gmsh -2 src/square.geo -o square.msh
gmsh -2 -format msh2 src/square.geo -o square.msh
../../bin/transform_mesh '(x,0.001*y)' square

clean:
Expand Down
Loading