Skip to content

Tidy up virtual functions in StdRegions and LocalRegions classes.

Chris Cantwell requested to merge ccantwel/nektar:feature/override into master

Issue/feature addressed

Some virtual functions were incorrectly overridden, or were left over in sub-classes after the public interface had been removed.

Proposed solution

Enforce correct implementation of these virtual functions and remove unnecessary functions from derived classes.

Implementation

  • Fixed those v_-prefixed functions which were not virtual.
  • The C++11 keyword override was applied to all virtual functions in derived classes; this enforces that a corresponding function exists in the base class.
  • final was applied conservatively where it is clear that a virtual function should not be further overridden.
  • Some functions were made const where it was obvious they should not be changing the member data (e.g. getter functions).
  • Some functions which must necessarily be overridden in all derived classes were switched to be pure virtual and the corresponding base class implementation removed.
  • Some functions Expansion::v_GetMF* were renamed, since they do not need to be virtual.
  • The *_MatOp functions were removed completely since they had no public interface function and are never used anyway since sum-factorisation is more efficient.

Tests

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).

Warning

On the 19.07 the code formatting (code style) was standardised using clang-format, over the whole Nektar++ code. This means changes in your branch will conflict with formatting changes on the master branch. To resolve these conflicts , see #295 (closed)

Edited by Chris Cantwell

Merge request reports