Skip to content

Draft: Change SessionReader::m_timelevel to string

Issue/feature addressed

m_timeLevel is introduced to SessionReader for Parallel-in-time, which enables the code to read different sets of parameters for different time levels. However, it can only recognize a tag name with a fixed keyword TIMELEVEL and integer VALUE, e.g.

<TIMElEVEL VALUE="0">

This MR tries to overcome such a limit and let it support a more general tag definition, so that we can utilize this feature in other applications, e.g. Multigrid

Proposed solution

Change the m_timeLevel from int to string m_solverTag . So that users can customize it based on their own needs.

Implementation

In the current parallel-in-time driver, if the caller passes the string "TIMELEVEL1" to the SessionReader, it will try to search for the following tag in the XML file

<SOLVERTAG VALUE="TIMELEVEL1">

and retrieve the parameters within that tag.

The default sessionReader (TIMELEVEL0) in parallel-in-time driver is initialized without a tag. In this case, m_solverTag will be set to "DEFAULT" and it will read parameters from:

<SOLVERTAG VALUE="DEFAULT">

If the keyword "SOLVERTAG" is not found in the XML file, the SessionReader will directly read parameters as usual.

For the coming multigrid application, we may use

<SOLVERTAG VALUE="DEFAULT">    <!--finest level-->
<SOLVERTAG VALUE="GRIDLEVEL1"> <!--coarse level 1-->
<SOLVERTAG VALUE="GRIDLEVEL2"> <!--coarse level 2-->

to define different parameters for different grid levels.

And for the multigrid velocity correction scheme, we may use

<SOLVERTAG VALUE="PressureDefault">    <!--finest level for pressure poisson equation -->
<SOLVERTAG VALUE="PressureGridLevel1"> <!--coarse level 1 for pressure poisson equation-->
<SOLVERTAG VALUE="ViscousDefault">     <!--finest level for viscous equation -->
<SOLVERTAG VALUE="ViscousGridLevel1">  <!--coarse level 1 for viscous equation-->

to set different parameters for pressure and viscous equations, respectively.

It may not be the clearest design, but at least it allows the users to define anything they want.

Tests

All existing parallel-in-time tests should pass.

Suggested reviewers

@CFD-Xing @dmoxey

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 BOYANG XIA

Merge request reports