LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
201 stars 36 forks source link

DMD time window variable basis dimensions #162

Closed dylan-copeland closed 1 year ago

dylan-copeland commented 1 year ago

This PR generalizes examples/dmd/parametric_tw_csv.cpp in multiple ways.

  1. Each time window can now use its own DMD dimension, read from a CSV file, rather than prescribing a fixed dimension for all windows. This is necessary for robustness.
  2. It can use HDF files partitioned in parallel by MPI rank. The sample runs in the comments, for a heat conduction example, were previously given with 8 MPI ranks. However, the problem is not actually distributed in parallel, so there is no advantage to parallelization. Since this heat conduction example is not yet set up to output partitioned data, this PR simply makes the sample runs serial. In general, parametric_tw_csv can be run on parallel distributed HDF files, with file names ending with _R.hdf, where R is the rank.
  3. The naming of the HDF files is now refactored in the function GetFilenameHDF, and different naming conventions can be used by specifying -hdfmode in the command line. There are many places where the HDF file name is used, so refactoring allows for new naming convetions to be implemented in just one place, in GetFilenameHDF. For example, the default convention is dmd_data/simS/fieldName_R.hdf for simulation S and MPI rank R, whereas -hdfmode 1 uses the convention dmd_data/fieldNameS_R.hdf
  4. Subsampling of snapshots is a new option, in both training and evaluation.
  5. The predicted solution can optionally be output in an HDF file.
chldkdtn commented 1 year ago

@dylan-copeland What is the status of this PR?

siuwuncheung commented 1 year ago

With the default value of mode, I guess it should not break any current capabilities. But since @debog and @ebchin both may use this script, I think it will be better for Debo and Eric to test if the changes in this PR won't break the current usage in their applications.