fixed a bug in ElUtil where varopti could segfault on non-tri or tet meshes
Issue/feature addressed
Bug discovered when applying VarOpti to meshes containing elements that are not tri or tet. ElUtil::UpdateMapping() assumed that m_maps.size() and m_mapsStd.size() are the same size, which is only true when m_derivUtil->pts; and m_derivUtil->ptsStd; are the same as well.
Proposed solution
Change the way ElUtil::UpdateMapping() loops over m_maps and m_mapsStd.
Implementation
In the proposed version, ElUtil::UpdateMaps does not loops over the maps when scaling is applied (instead of multiplying and dividing by 1!) and instead assigns maps=m_maps and mapsStd=m_mapsStd directly. When scaling is applied then first loop over the min size of m_maps, m_mapsStd and apply the scaling to both, then continue to loop and apply the scaling over only the larger of the two.
Tests
Nothing new here.
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)