Skip to content

Investigate possible bug when handling non-contiguous node tags in Gmsh parser #96

Closed

Description

@nikoscham

Importing a Gmsh mesh with gaps in its node tags might creates extra, disconnected nodes in the solver matrix. A heat-conduction solve using Jacobi then might divide by zero and return NaN temperatures.

Activity

  1. self-assigned this
    on Oct 28, 2026
  2. added theissue type on Oct 28, 2026
  3. nikoscham commented on Oct 28, 2026

    @nikoscham
    MemberAuthor

    Confirmed and fixed. The Gmsh reader stored node coordinates at nodeTag - 1, so gaps in the node tags created extra nodes that no element uses. Their rows in the system matrix were all zeros: Jacobi divided by zero and returned NaN at every node, and the LU solver failed outright. The reader now detects gaps from the $Nodes header (max tag > number of nodes) and maps node tags to compact indices, including in element and boundary references. Meshes with contiguous tags, which is the usual Gmsh output, are read exactly as before.
    A new unit test (tests/unit/gmshReader.test.js) copies the test meshes with gaps in their node tags and checks that the nodes, connectivity and solution are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions