HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
ROM object of type DMD (see libROM) More...
#include <rom_object_dmd.h>
Public Member Functions | |
DMDROMObject (const int, const double, const int, const int, const int, const int, const int a_var_idx=-1) | |
virtual | ~DMDROMObject () |
virtual void | projectInitialSolution (CAROM::Vector &a_U) |
virtual void | takeSample (const CAROM::Vector &, const double) |
virtual void | train () |
virtual const CAROM::Vector *const | predict (const double a_t) const |
virtual void | save (const std::string &a_fname_root) const |
virtual void | load (const std::string &a_fname_root) |
Public Member Functions inherited from ROMObject | |
virtual | ~ROMObject () |
Protected Attributes | |
std::vector< CAROM::DMD * > | m_dmd |
std::vector< bool > | m_dmd_is_trained |
std::vector< Interval > | m_intervals |
int | m_rank |
int | m_nproc |
int | m_vec_size |
double | m_dt |
double | m_t_final |
int | m_rdim |
int | m_num_window_samples |
int | m_tic |
int | m_curr_win |
int | m_sim_idx |
int | m_var_idx |
bool | m_write_snapshot_mat |
std::string | m_dirname |
ROM object of type DMD (see libROM)
ROM object of type DMD (see libROM) DMD-type ROM (see libROM for details)
DMD-type ROM (see libROM for details). DMD stands for "Dynamic Mode Decomposition".
Definition at line 37 of file rom_object_dmd.h.
DMDROMObject | ( | const int | a_vec_size, |
const double | a_dt, | ||
const int | a_rdim, | ||
const int | a_rank, | ||
const int | a_nproc, | ||
const int | a_sim_idx, | ||
const int | a_var_idx = -1 |
||
) |
Constructor
Constructor This function will also look into the file librom.inp for DMD-specific options. Rank 0 reads in the inputs and broadcasts them to all the processors.
The format of librom.inp is as follows:
begin <keyword> <value> ... <keyword> <value> end
where the list of keywords and their type (that this function will look for) are:
Keyword name | Type | Variable | Default value |
---|---|---|---|
dmd_num_win_samples | int | DMDROMObject::m_num_window_samples | INT_MAX |
dmd_dirname | string | DMDROMObject::m_dirname | "DMD" |
dmd_write_snapshot_mat | bool | DMDROMObject::m_write_snapshot_mat | false |
Note: other keywords in this file may be read by other functions.
a_vec_size | vector size |
a_dt | time step size |
a_rdim | latent space dimension |
a_rank | MPI rank of this process |
a_nproc | Number of MPI processes |
a_sim_idx | Simulation index (for ensemble simulations |
a_var_idx | Vector component index |
Definition at line 35 of file DMDROMObject.cpp.
|
inlinevirtual |
|
inlinevirtual |
Project initial solution for prediction
a_U | solution vector |
Implements ROMObject.
Definition at line 60 of file rom_object_dmd.h.
|
virtual |
take a sample (solution snapshot)
a_U | solution vector |
a_time | sample time |
Implements ROMObject.
Definition at line 126 of file DMDROMObject.cpp.
|
virtual |
train the DMD object
train the DMD objects
Implements ROMObject.
Definition at line 182 of file DMDROMObject.cpp.
|
inlinevirtual |
compute prediction at given time
a_t | time at which to predict solution |
Implements ROMObject.
Definition at line 84 of file rom_object_dmd.h.
|
virtual |
save DMD object to file
Save DMD objects to file: the DMD object files will be saved in the subdirectory with the name DMDROMObject::m_dirname. They are in a format that libROM can read from.
Note: If the subdirectory DMDROMObject::m_dirname does not exist, the DMD objects will not be written (even though the screen output will claim they were written)!. The code may not report any error, or one may see HDF5 file writing errors.
a_fname_root | Filename root |
Implements ROMObject.
Definition at line 235 of file DMDROMObject.cpp.
|
virtual |
load DMD object from file
Load DMD objects from file: the DMD object files must be in the subdirectory with the name DMDROMObject::m_dirname. They must be in a format that libROM can read from. The number of objects and their parameters must correspond to the simulation being run for which this object is defined.
a_fname_root | Filename root |
Implements ROMObject.
Definition at line 281 of file DMDROMObject.cpp.
|
protected |
Vector of DMD objects
Definition at line 104 of file rom_object_dmd.h.
|
protected |
Flag to indicate if DMD is trained
Definition at line 105 of file rom_object_dmd.h.
|
protected |
Time intervals for each DMD object
Definition at line 106 of file rom_object_dmd.h.
|
protected |
MPI rank
Definition at line 108 of file rom_object_dmd.h.
|
protected |
Number of MPI ranks
Definition at line 109 of file rom_object_dmd.h.
|
protected |
Local size of solution vector
Definition at line 111 of file rom_object_dmd.h.
|
protected |
Time step size
Definition at line 112 of file rom_object_dmd.h.
|
protected |
Final time
Definition at line 113 of file rom_object_dmd.h.
|
protected |
Latent space dimension
Definition at line 114 of file rom_object_dmd.h.
|
protected |
Number of samples per DMD for time-windowing
Definition at line 116 of file rom_object_dmd.h.
|
protected |
private ticker to count number of samples taken
Definition at line 118 of file rom_object_dmd.h.
|
protected |
private index for current window
Definition at line 119 of file rom_object_dmd.h.
|
protected |
simulation index of this object for ensemble simulations
Definition at line 121 of file rom_object_dmd.h.
|
protected |
component index of this object if component-wise ROMs are being used
Definition at line 122 of file rom_object_dmd.h.
|
protected |
Write snapshot matrix to file or not
Definition at line 124 of file rom_object_dmd.h.
|
protected |
Subdirectory where DMD objects are written to or read from
Definition at line 126 of file rom_object_dmd.h.