Skip to content

Fix fld file import with singlemode expansion

Issue/feature addressed

In function void ExpListHomogeneous1D::v_ExtractDataToCoeffs, the offset, which is 2 for single mode expansion, is not added when building the m_zIdToPlane. This causes the restart file and the bodyforce file cannot be properly imported, since the planes they contained are IDs 2 and 3.

On the other hand, the baseflow file is on plane ID 0. If we added the offset=2 to m_zIdToPlane, the baseflow will not be corrected imported.

close issue #320 (closed)

When importing the baseflow, the code assumes that the variables and their orders in the baseflow and in the session files are the same. Sometimes, the baseflow is computed from another solver or generated by combining several files. These situations are not considered in the current code.

Proposed solution

An argument std::unordered_map<int, int> zIdToPlane is added to functions ExtractDataToCoeffs and v_ExtractDataToCoeffs. The default value of zIdToPlane is an empty map. If zIdToPlane is unempty, it will be used to replace the origional m_zIdToPlane.

Implementation

Tests

A test has been added.

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.
  • [ ] Newly added files are correctly formatted.
  • [ ] License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files). fix issue #310 (closed)
Edited by Jacques Xing

Merge request reports