49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wold-style-cast"
51#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
52#include <Spectra/GenEigsSolver.h>
53#include <Spectra/SymEigsSolver.h>
55#include <unsupported/Eigen/SparseExtra>
56#include <unsupported/Eigen/MatrixFunctions>
58#pragma GCC diagnostic pop
68template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
79 ITHACADMD(PtrList<GeometricField<Type, PatchField, GeoMesh>>& snapshots,
131 void getModes(label SVD_rank = -1,
bool exact =
true,
132 bool exportDMDmodes =
false);
153 void getDynamics(
double tStart,
double tFinal,
double dt);
158 void reconstruct(word exportFolder, word fieldName);
Header file of the EigenFunctions class.
Header file of the Foam2Eigen class.
ITHACADMD< scalar, fvPatchField, volMesh > ITHACADMDvolScalar
ITHACADMD< vector, fvPatchField, volMesh > ITHACADMDvolVector
Header file of the ITHACAPOD class.
Header file of the ITHACAstream class, it contains the implementation of several methods for input ou...
Header file of the ITHACAutilities namespace.
Header file of the Modes class.
Class of the computation of the DMD, it exploits the SVD methods.
void convert2Foam()
Convert the EigenModes in Matrix form into OpenFOAM GeometricFields.
label SVD_rank_public
Rank of the DMD.
ITHACADMD(PtrList< GeometricField< Type, PatchField, GeoMesh > > &snapshots, double dt)
Constructs the object.
PtrList< GeometricField< Type, PatchField, GeoMesh > > snapshotsDMD
PtrList of OpenFOAM GeoometricFields where the snapshots are stored.
Eigen::VectorXd Amplitudes
Amplitudes of DMD.
void getDynamics(double tStart, double tFinal, double dt)
Export the dynamics of DMD given an initial time step, a final one and a time step.
double originalDT
Original time step used to acquire the snapshots.
void reconstruct(word exportFolder, word fieldName)
Reconstruct and export the solution using the computed dynamics.
Eigen::MatrixXcd dynamics
Complex Eigen::Matrix used to store the Dynamics of the DMD modes.
List< Eigen::MatrixXcd > PODmBC
List of complex matrices used to store the POD modes on the boundaries, used only for compution in th...
void exportEigs(word exportFolder)
Export the eigenvalues in numpy format.
Modes< Type, PatchField, GeoMesh > DMDmodesImag
Modes object used to store the Imaginary part of the DMD modes.
List< Eigen::MatrixXcd > DMDEigenModesBC
DMD modes on the boundary stored in a List of complex Eigen::Matrix, it is the object used for comput...
label NSnaps
Number of snapshots.
void getModes(label SVD_rank=-1, bool exact=true, bool exportDMDmodes=false)
Get the DMD modes.
Modes< Type, PatchField, GeoMesh > DMDmodesReal
Modes object used to store the Real part of the DMD modes.
Eigen::VectorXcd eigenValues
Eigenvalues of the dynamics mode decomposition.
bool redSVD
If true, it uses the Randomized SVD.
Eigen::MatrixXcd PODm
Complex matrix used to store the POD modes, used only for compution in the projected approach.
Eigen::MatrixXcd DMDEigenModes
DMD modes stored in a complex Eigen::Matrix, it is the object used for computations.
Implementation of a container class derived from PtrList.