Skip to content

Fix for edge IDs in NekMesh/MeshElements/Tetrahedron.cpp

Mashy Green requested to merge fix/MeshElementTet_edge_id into master

Issue/feature addressed

When constructing a new Tetrahedron element in NekMesh, no edge ids are assigned. This causes a problem in some modules, in particularly ProcessLinear, where called Tetrahedron::GetGeom(int coordDim) would throw a segmentation fault as it tries to access the edge IDs that have not been initialised.

Proposed solution

Assign values to the edge IDs when constructing a tetrahedron.

Implementation

Assign values to the edge IDs when constructing a tetrahedron.

Tests

No additional tests required. We could add a test to the ProcessLinear module to test other element types. This is not directly related, but such a test would have caught this bug faster.

Suggested reviewers

Kaloyan

Notes

This is a one-liner rather obvious bug that needed fixing but never got caught as we almost always run ProcessEdges after constructing elements which would hide this fault. If you think it is worth adding the suggested test I will do so, but we are working on overhauling the whole NekMesh testing suit so personally I would merge it without the additional test as they will be added in time regardless.

Checklist

  • Functions and classes, or changes to them, are documented.
  • User guide/documentation is updated.
  • Changelog is updated.
  • Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines).
  • License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Mashy Green

Merge request reports