libROM  v1.0
Data-driven physical simulation library
AdaptiveDMD.h
1 
11 // Description: Computes the AdaptiveDMD algorithm on the given snapshot matrix.
12 // The AdaptiveDMD algorithm should be used if the dt changes
13 // between the samples. This algorithm uniformly interpolates the samples
14 // that may have been taken with variable steps, using the constant step dt
15 // (a prequisite of the DMD algorithm). The smaller dt is, the finer
16 // the fidelity of the interpolation.
17 
18 #ifndef included_AdaptiveDMD_h
19 #define included_AdaptiveDMD_h
20 
21 #include "DMD.h"
22 #include <vector>
23 
24 namespace CAROM {
25 
26 class Vector;
27 
31 class AdaptiveDMD : public DMD
32 {
33 public:
34 
56  AdaptiveDMD(int dim, double desired_dt = -1.0, std::string rbf = "G",
57  std::string interp_method = "LS", double closest_rbf_val = 0.9,
58  bool alt_output_basis = false,
59  std::shared_ptr<Vector> state_offset = nullptr);
60 
65 
72  void train(double energy_fraction, const Matrix* W0 = NULL,
73  double linearity_tol = 0.0);
74 
81  void train(int k, const Matrix* W0 = NULL, double linearity_tol = 0.0);
82 
86  double getTrueDt() const;
87 
91  std::unique_ptr<const Matrix> getInterpolatedSnapshots();
92 
93 private:
94 
98  AdaptiveDMD();
99 
103  AdaptiveDMD(
104  const AdaptiveDMD& other);
105 
109  AdaptiveDMD&
110  operator = (
111  const AdaptiveDMD& rhs);
112 
117  std::string d_rbf;
118 
123  std::string d_interp_method;
124 
128  std::vector<std::shared_ptr<Vector>> d_interp_snapshots;
129 
133  void interpolateSnapshots();
134 
138  double d_closest_rbf_val;
139 };
140 
141 }
142 
143 #endif
~AdaptiveDMD()
Destroy the AdaptiveDMD object.
Definition: AdaptiveDMD.h:64
double getTrueDt() const
Get the true dt between interpolated snapshots.
std::unique_ptr< const Matrix > getInterpolatedSnapshots()
Get the interpolated snapshot matrix contained within d_interp_snapshots.
void train(double energy_fraction, const Matrix *W0=NULL, double linearity_tol=0.0)
Definition: AdaptiveDMD.cpp:37
Definition: DMD.h:71