{"id": "imported_mesh", "title": "Imported meshes", "description": "A mesh read from a file must behave exactly like a generated one, including unstructured topology, where neighbouring elements use different local axes. (i) Every Gmsh fixture of the test suite is read; the files are genuine Gmsh output (tools/make_mesh_fixtures.py), and on the straight-sided ones every high-order node must be the multilinear image of the element's vertices, which tests the node-ordering tables for quadrilaterals of degree 1 to 5 and hexahedra of degree 1 to 4. (ii) On curved unstructured meshes from Gmsh in 2-D and 3-D, and on a 3-D mesh whose elements were randomly re-oriented and passed through a file, a uniform flow must remain steady, the residuals of a perturbed state must sum to zero, and the inviscid residual of a continuous state must not depend on the Riemann solver away from the boundary (the jump across every face is zero only if its nodes are matched with the right ones of the neighbour; the viscous terms cancel in this comparison, so it is made for the Euler equations only). The coupling of the viscous terms across faces (gradient traces of the neighbour, lifted jumps) is tested separately, for both sets of equations: a rough state with varying velocity and temperature and a jump on every face must give the same residual, node by node, when every element of the mesh is stored in other, randomly chosen local axes. (iii) The coarse annulus of the cylinder case, written to a Gmsh file after randomly re-orienting its elements and read back through a case specification, must give the force coefficients of the generated mesh to solver tolerance. (iv) Laminar flow past a cylinder in a channel (Re = 40, M = 0.2, slip walls) is solved on the unstructured example mesh at degree 2, and the adjoint derivative of the drag coefficient with respect to the Mach number is compared with a central finite difference of re-converged flows.", "passed": true, "checks": [{"name": "usable Gmsh fixtures read", "value": "15 of 15", "expected": "all", "passed": true}, {"name": "unusable Gmsh fixtures (triangles, binary, untagged) refused with a message", "value": "3 of 3", "expected": "all", "passed": true}, {"name": "straight-sided fixtures cover quadrilaterals of degree 1\u20135 and hexahedra of degree 1\u20134", "value": 9, "expected": "= 9 (dimension, degree) pairs", "passed": true}, {"name": "node ordering: largest distance of a node of a straight-sided mesh from the multilinear map of its vertices", "value": 4.440892098500626e-15, "expected": "< 1e-13 (round-off; coordinates of order one)", "passed": true}, {"name": "straight-sided meshes: relative error of the area / volume", "value": 3.058465632576189e-16, "expected": "< 1e-12 (the quadrature is exact for multilinear elements)", "passed": true}, {"name": "every straight-sided fixture is unstructured: fewest face pairs with a non-identity orientation", "value": 44, "expected": "> 0", "passed": true}, {"name": "curved quadrilateral meshes (circular hole): area error at geometry degree pg + 1 relative to pg, largest", "value": 0.1472555680587868, "expected": "< 1 (the boundary interpolant converges with the degree)", "passed": true}, {"name": "MSH 2.2 and MSH 4.1 files of one periodic mesh: largest node difference", "value": 0.0, "expected": "< 1e-12", "passed": true}, {"name": "periodic node pairs of the file became topology (slave nodes)", "value": 13, "expected": "> 0, and no boundary group on the periodic sides", "passed": true}, {"name": "hole_quad_p3.msh (Gmsh, curved, 2-D), inviscid: perturbed state is not trivial (max |Rw|)", "value": 0.4157744112481682, "expected": "> 1e-3", "passed": true}, {"name": "hole_quad_p3.msh (Gmsh, curved, 2-D), viscous: perturbed state is not trivial (max |Rw|)", "value": 0.4358977829968271, "expected": "> 1e-3", "passed": true}, {"name": "hole_quad_p3.msh (Gmsh, curved, 2-D): face pairs with a non-identity orientation", "value": 48, "expected": "> 0", "passed": true}, {"name": "hole_hex_p2.msh (Gmsh, curved, 3-D), inviscid: perturbed state is not trivial (max |Rw|)", "value": 0.6202721959051228, "expected": "> 1e-3", "passed": true}, {"name": "hole_hex_p2.msh (Gmsh, curved, 3-D), viscous: perturbed state is not trivial (max |Rw|)", "value": 0.3061931112820888, "expected": "> 1e-3", "passed": true}, {"name": "hole_hex_p2.msh (Gmsh, curved, 3-D): face pairs with a non-identity orientation", "value": 72, "expected": "> 0", "passed": true}, {"name": "periodic warped 3x3x3 box, re-oriented, written and read back, inviscid: perturbed state is not trivial (max |Rw|)", "value": 0.11511616505271517, "expected": "> 1e-3", "passed": true}, {"name": "periodic warped 3x3x3 box, re-oriented, written and read back, viscous: perturbed state is not trivial (max |Rw|)", "value": 0.12042505368020784, "expected": "> 1e-3", "passed": true}, {"name": "periodic warped 3x3x3 box, re-oriented, written and read back: face pairs with a non-identity orientation", "value": 74, "expected": "> 0", "passed": true}, {"name": "re-oriented 3-D box read from a file: relative face orientations present", "value": 8, "expected": "= 8 (all)", "passed": true}, {"name": "free stream on imported meshes: largest max |Rw|", "value": 4.440892098500626e-15, "expected": "< 1e-12", "passed": true}, {"name": "conservation on imported meshes: largest |sum of Rw| of a perturbed state", "value": 1.3766765505351941e-14, "expected": "< 1e-12 (residuals of order 0.1 to 1)", "passed": true}, {"name": "neighbour matching on imported meshes (inviscid): largest |Rw(Roe) \u2212 Rw(LLF)| off the boundary for a continuous state", "value": 9.992007221626409e-16, "expected": "< 1e-12 (zero jump across every correctly matched face; residuals of order 0.1 to 1)", "passed": true}, {"name": "neighbour coupling on imported meshes, Euler and Navier\u2013Stokes: largest difference of the residual of a rough state between two descriptions of the mesh (elements re-oriented)", "value": 2.481348460037225e-14, "expected": "< 1e-12 (round-off; residuals of order 0.1 to 1)", "passed": true}, {"name": "the rough state exercises the viscous terms: smallest max |Rw(Navier\u2013Stokes) \u2212 Rw(Euler)|", "value": 0.022710454629822262, "expected": "> 1e-3 (velocity and temperature vary; far above the bound of the coupling check)", "passed": true}, {"name": "generated and imported annulus: both solves converged", "value": true, "expected": "true", "passed": true}, {"name": "imported annulus: face pairs with a non-identity orientation", "value": 42, "expected": "> 0 (elements were re-oriented before writing)", "passed": true}, {"name": "force and moment coefficients, |imported \u2212 generated| (largest)", "value": 2.1316282072803006e-14, "expected": "< 1e-10 (both solves reduce the residual by 1e-12)", "passed": true}, {"name": "cylinder in a channel (examples/meshes/cylinder_channel_p3.msh), Re = 40, p = 2: converged", "value": true, "expected": "true", "passed": true}, {"name": "cylinder in a channel: dcd/dmach, adjoint vs central finite difference (rel.)", "value": 1.182458651037207e-07, "expected": "< 1e-6", "passed": true}], "charts": [{"id": "residual_history", "type": "history", "title": "Residual histories on generated and imported meshes", "xlabel": "nonlinear iteration", "ylabel": "|Rw|", "xscale": "linear", "yscale": "log", "series": [{"name": "annulus, generated", "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "y": [28.359464866788425, 18.841340489907395, 15.403524403703198, 5.387645688711359, 4.32121613114265, 1.0445921356193004, 0.20382422565185343, 0.07632921666951907, 0.0073100080930034415, 0.00010453188635083793, 1.0184812335688795e-06, 8.294893307259215e-09, 5.3854423445914386e-11, 1.1602001152500998e-12]}, {"name": "annulus, re-oriented and read from a file", "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "y": [28.359464866788425, 18.84134048990741, 15.40352440370318, 5.387645688711383, 4.321216131142612, 1.0445921356193055, 0.2038242256518691, 0.07632921666948506, 0.007310008092979787, 0.00010453188623105816, 1.0184812703044142e-06, 8.294899452477051e-09, 5.3709077929296465e-11, 1.0161897513733906e-12]}, {"name": "cylinder in a channel (Gmsh mesh)", "x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "y": [24.773660937891968, 13.875278589105148, 8.51098231750744, 5.122280747415339, 3.3528968593537907, 2.029501644456385, 0.9105155523286481, 0.36901957481062847, 0.08927224442481324, 0.036369848911217306, 0.002623422772280713, 3.145959227431827e-05, 3.0281202914057094e-07, 2.5325234260855063e-09, 1.9079076154623554e-11]}], "note": "The histories of the generated and of the imported annulus coincide."}], "tables": [{"id": "fixtures", "title": "Gmsh fixtures (tests/data/meshes)", "columns": ["file", "dim", "geometry degree", "elements", "nodes", "face pairs with non-identity orientation", "min scaled Jacobian", "distance from the multilinear map", "relative area / volume error", "format / outcome"], "rows": [["hole_hex_p2.msh", 3, 2, 78, 896, 72, 0.13862496438307617, null, 4.30030208667415e-05, "gmsh-4.1"], ["hole_quad_p2.msh", 2, 2, 136, 600, 48, 0.3619627018509738, null, 2.724960004926687e-06, "gmsh-4.1"], ["hole_quad_p3.msh", 2, 3, 136, 1308, 48, 0.3619627018509721, null, 4.012655334629538e-07, "gmsh-2.2"], ["hole_quad_p4.msh", 2, 4, 136, 2288, 48, 0.3619627018509877, null, 1.042062478728813e-09, "gmsh-4.1"], ["periodic_channel_p3_v2.msh", 2, 3, 24, 247, 0, 0.8865081116171234, null, null, "gmsh-2.2"], ["periodic_channel_p3_v4.msh", 2, 3, 24, 247, 0, 0.8865081116171234, null, null, "gmsh-4.1"], ["reject_binary.msh", null, null, null, null, null, null, null, null, "refused: binary MSH files are not supported: save as ASCII (Mesh.Binary = 0, or `gmsh -format msh41"], ["reject_triangles.msh", null, null, null, null, null, null, null, null, "refused: the mesh contains triangles. Gyre needs an all-quadrilateral (2-D) or all-hexahedral (3-D)"], ["reject_untagged.msh", null, null, null, null, null, null, null, null, "refused: 32 boundary faces belong to no physical group (the first one is near (3, -1.125)). Give ev"], ["straight_hex_p1.msh", 3, 1, 60, 126, 44, 0.3103015884970943, 0.0, 1.5292328162880946e-16, "gmsh-2.2"], ["straight_hex_p2.msh", 3, 2, 60, 720, 44, 0.31030158849709294, 1.3322676295501878e-15, 0.0, "gmsh-4.1"], ["straight_hex_p3.msh", 3, 3, 60, 2142, 44, 0.31030158849709244, 2.220446049250313e-15, 0.0, "gmsh-2.2"], ["straight_hex_p4.msh", 3, 4, 60, 4752, 44, 0.31030158849709694, 4.440892098500626e-15, 3.058465632576189e-16, "gmsh-4.1"], ["straight_quad_p1.msh", 2, 1, 120, 144, 44, 0.47363384311089374, 0.0, 1.2233862530304756e-16, "gmsh-4.1"], ["straight_quad_p2.msh", 2, 2, 120, 528, 44, 0.47363384311089435, 1.3322676295501878e-15, 0.0, "gmsh-2.2"], ["straight_quad_p3.msh", 2, 3, 120, 1152, 44, 0.47363384311089646, 1.3322676295501878e-15, 2.446772506060951e-16, "gmsh-4.1"], ["straight_quad_p4.msh", 2, 4, 120, 2016, 44, 0.4736338431109008, 2.4424906541753444e-15, 2.446772506060951e-16, "gmsh-2.2"], ["straight_quad_p5.msh", 2, 5, 120, 3120, 44, 0.47363384311090745, 3.1086244689504383e-15, 2.446772506060951e-16, "gmsh-4.1"]]}, {"id": "invariants", "title": "Free stream, conservation and neighbour coupling on imported meshes", "columns": ["mesh", "p", "equations", "elements", "interior face pairs", "non-identity orientation", "relative orientations present", "free stream max |Rw|", "perturbed nodes", "perturbed elements", "max |Rw| of the perturbed state", "|sum of Rw| (conservation)", "max |Rw| of the continuous state (inviscid)", "max |Rw(Roe) \u2212 Rw(LLF)| off the boundary (inviscid)", "non-identity orientation after re-orienting", "max |Rw| of the rough state", "max |Rw(Navier\u2013Stokes) \u2212 Rw(Euler)| of the rough state", "max |Rw \u2212 Rw re-oriented| of the rough state"], "rows": [["hole_quad_p3.msh (Gmsh, curved, 2-D)", 3, "Euler", 136, 244, 48, "2 of 2", 4.440892098500626e-15, "1956 of 2176", 136, 0.4157744112481682, 6.078471059822732e-15, 0.37424155993658165, 9.992007221626409e-16, 131, 0.8258994816718345, null, 2.475797344914099e-14], ["hole_quad_p3.msh (Gmsh, curved, 2-D)", 3, "Navier\u2013Stokes", 136, 244, 48, "2 of 2", 4.440892098500626e-15, "1344 of 2176", 84, 0.4358977829968271, 1.3766765505351941e-14, null, null, 131, 0.8578551377650784, 0.10818426408048054, 2.481348460037225e-14], ["hole_hex_p2.msh (Gmsh, curved, 3-D)", 2, "Euler", 78, 172, 72, "2 of 8", 1.052655904829778e-15, "1162 of 2106", 78, 0.6202721959051228, 3.910066714851723e-15, 0.7321089667514926, 5.273559366969494e-16, 156, 0.8463793448128053, null, 7.382983113757291e-15], ["hole_hex_p2.msh (Gmsh, curved, 3-D)", 2, "Navier\u2013Stokes", 78, 172, 72, "2 of 8", 1.052655904829778e-15, "162 of 2106", 6, 0.3061931112820888, 5.217289274217496e-15, null, null, 156, 0.8539961368646026, 0.13985704939771362, 7.382983113757291e-15], ["periodic warped 3x3x3 box, re-oriented, written and read back", 2, "Euler", 27, 81, 74, "8 of 8", 5.26327952414889e-16, "729 of 729", 27, 0.11511616505271517, 5.412337245047638e-16, 0.11322599381508396, 2.636779683484747e-16, 67, 0.18175123857378658, null, 4.468647674116255e-15], ["periodic warped 3x3x3 box, re-oriented, written and read back", 2, "Navier\u2013Stokes", 27, 81, 74, "8 of 8", 5.26327952414889e-16, "729 of 729", 27, 0.12042505368020784, 1.8596235662471372e-15, null, null, 67, 0.18704031610751504, 0.022710454629822262, 4.475586568020162e-15]]}, {"id": "equivalence", "title": "Cylinder Re = 40 on the generated annulus (12 x 4, p = 2) and on the same mesh read from a file", "columns": ["quantity", "generated", "imported", "difference"], "rows": [["cd", 1.6982389288193027, 1.698238928819324, 2.1316282072803006e-14], ["cl", -2.093290818461213e-14, -2.185231162687984e-14, 9.194034422677078e-16], ["cm", -2.815889882379352e-15, -6.915908817850536e-15, 4.1000189354711836e-15], ["Newton steps", 13, 13, null], ["final / reference residual", 4.091050803320348e-14, 3.5832472726361046e-14, null]]}, {"id": "channel", "title": "Cylinder in a channel on examples/meshes/cylinder_channel_p3.msh", "columns": ["quantity", "value"], "rows": [["elements", 284], ["geometry degree", 3], ["degrees of freedom", 10224], ["face pairs with a non-identity orientation", "104 of 528"], ["Newton steps", 14], ["final / reference residual", 7.701355162022745e-13], ["cd", 3.210388630431887], ["cl", 0.00022180355567114063], ["cm (about the cylinder axis)", -0.002008622075159394], ["dcd/dmach, adjoint", 0.3310887906981179], ["dcd/dmach, central difference (step 0.0001)", 0.33108882984800303], ["relative difference", 1.182458651037207e-07]]}], "provenance": {"version": "0.4.0", "commit": "39979fcf902ad6116eb550b881b4278d4599c8e2", "dirty": false, "describe": "39979fcf90", "device": {"platform": "cpu", "device": "cpu:0", "device_kind": "cpu", "jax": "0.11.2", "x64": true}, "timestamp": "2026-11-12T11:46:10-0500"}, "wall_time": 184.52, "notes": "Measured in this run: the largest free-stream residual on the imported meshes was 4.4e-15, the largest conservation defect 1.4e-14 and the largest dependence of the inviscid residual of a continuous state on the Riemann solver 1.0e-15. The residual of a rough state changed by at most 2.5e-14 when the elements were re-oriented, with and without viscous terms; the viscous terms contributed between 2.3e-02 and 1.4e-01 to that residual. Conservation alone would not notice a wrong index map between two straight faces (their normals are constant); the Riemann-solver comparison (trace matching, an inviscid test: the viscous terms cancel in it), the comparison of two descriptions (which includes the gradient traces and lifted jumps of the viscous discretization) and the solves of parts (iii) and (iv) do. The annulus written to a file with re-oriented elements (42 of 84 face pairs with a non-identity orientation) gave force coefficients within 2.1e-14 of those on the generated mesh. On the example mesh the adjoint derivative of the drag coefficient with respect to the Mach number differs from the central difference by a relative 1.2e-07. The Gmsh fixtures contain only two of the eight relative face orientations of hexahedra (see the table); all eight occur in the re-oriented box, which is written by Gyre's own writer, not by Gmsh.", "level": "quick"}