Skip to content

Remove many instances of Array<OneD, ...> in favour of std::array inside NekMesh

Dave Moxey requested to merge meshing/nektar:feature/nekmesh-array into master

Issue/feature addressed

This MR replaces the usage of Array<OneD, ...> in a number of places where e.g. coordinates are used. For example coordinates instead of being represented as:

Array<OneD, NekDouble> xc(3);

are now written as

std::array<NekDouble, 3> xc;

This is to:

  • bypass the use of Array for small entries, which seems to be computational expensive
  • avoid issues in Array memory allocation, which is not thread-safe for use in e.g. NodeOptiCAD for the variational optimiser
  • clearly indicate how many components are stored in e.g. CAD output. For example, CAD surfaces admit 18 second-order derivative entries which are now encoded directly as std::array<NekDouble, 18>

Implementation

A more detailed description of the changes. Please include any details necessary for reviewers to understand your work, and point out particular points would like them to pay particular attention to.

Tests

The NekMesh_MeshGen/STEP/2d_circle_square-radapt test has been updated to use two threads which previous to this MR failed due to the use of the non-thread safe Array<OneD, NekDouble>. The other tests in NekMesh_MeshGen/STEP also cover some other use of the CAD API with OCE.

Suggested reviewers

Please suggest any people who would be appropriate to review your code.

Notes

Please add any other information that could be useful for reviewers.

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