Skip to content

Save BndElmtExpansion and avoid re-building

Issue/feature addressed

The first round of performance tests for the IncNavierStokesSolver showed a strong increase in runtime between version 5.0.2 and 5.1.0. An investigation showed that the difference mainly comes from the CalcNeumannPressureBcs where the BndElmtExpansions are re-computed at every time step. This caused re-initilisation of the Collections-operators which is the reason for increased execution time.

Proposed solution

We can circumvent the re-initilisation by building the BndElmtExpansions only once and saving them as part of the Extrapolation class.

Implementation

The new member variable is initialised upon the first call of CalcNeumannPressureBcs by checking the size of the new Array<OneD, ExpList> m_bndElmtExps and subsequently used to access any expansions touching domain boundaries.

Tests

  • Since this is a performance fix, all current tests are ample evidence for the merge-request to be working correctly.
  • We might see an influence on the performance tests for IncNavierStokesSolver.
  • The average run time of the performance test decreases from 15.7584s to 13.7580s.

Suggested reviewers

@ccantwel @ssherw

Notes

  • Also, the BndElmtExpansions should, in theory, also be used for the convective outflow BCs (ConvOBC). However the tests fail when this new boundary expansion container is used. I am not sure whether the phys/coeff space in m_bndElmtExps need manual updating every time-step to fix this.
  • There might be an issue with VCSGlobalMapping if time-dependent domain boundaries are used.

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 Jacques Xing

Merge request reports