49 Foam::word field_name;
51 const Foam::fileName& casenameData;
53 Foam::label l_nSnapshot;
55 const Foam::label l_nBlocks;
60 Foam::word l_hilbertSp;
64 const double weightBC;
66 const Foam::word patchBC;
68 Foam::label l_startTime;
70 Foam::label l_endTime;
73 Foam::label l_nSnapshotSimulation;
75 const Foam::label l_endTimeSimulation;
79 fileName snapshotsPath;
82 Foam::instantList timeFolders;
85 Foam::fileName name_covMatrix;
86 Foam::word folder_covMatrix;
90 Foam::fileName name_eigenValues;
91 Foam::fileName name_eigenValuesNormalized;
92 Foam::fileName name_cumEigenValues;
93 Foam::fileName name_eigenVector;
94 Foam::word folder_eigen;
95 bool exist_eigenDecomposition;
98 Foam::word folder_spatialModes;
99 bool exist_spatialModes;
102 Foam::word folder_temporalModes;
103 bool exist_temporalModes;
106 Foam::word folder_temporalModesSimulation;
107 bool exist_temporalModesSimulation;
114 bool b_centeredOrNot;
116 Foam::word folder_mean;
120 Eigen::VectorXd eigenValueseigLam;
121 Eigen::VectorXd lambda;
123 const Foam::word w_eigensolver;
124 const int i_precision;
125 const std::_Ios_Fmtflags ios_outytpe;
127 const Foam::Time runTime2;
129 Eigen::MatrixXi inletIndex;
131 Foam::PtrList<T> liftfield;
135 PODTemplate(
Parameters* myParameters,
const Foam::word& myfield_name,
const word& mySnapshots_path =
"default_path");
138 virtual ~PODTemplate();
148 void computeMeanField();
153 void appendMeanfieldtoSpatialModes(Foam::PtrList<T>& spatialModes);
158 void findTempFile(Eigen::MatrixXd* covMat,
int* index1,
int* index2);
161 Foam::word nameTempCovMatrix(
int i,
int j);
164 void saveTempCovMatrix(Eigen::MatrixXd& covMatrix,
int i,
int j);
167 void deleteTempCovMatrix(
int i,
int j);
170 void deletePreviousTempCovMatrix_N(
int* valI,
int* valJ,
int i,
int j,
int N);
176 virtual Eigen::MatrixXd buildCovMatrix();
183 void addCovMatrixTriCoeff(Eigen::MatrixXd& covMatrix,
184 Foam::PtrList<T>& snapshots,
192 void addCovMatrixSquareCoeff(Eigen::MatrixXd& covMatrix,
193 Foam::PtrList<T>& snapshots1,
194 Foam::PtrList<T>& snapshots2,
205 void diagonalisation(Eigen::MatrixXd& covMatrix,
206 Eigen::VectorXd& eigenValueseig, Eigen::MatrixXd& eigenVectoreig);
215 Foam::PtrList<T> computeSpatialModes(Eigen::VectorXd& eigenValueseig,
216 Eigen::MatrixXd& eigenVectoreig);
231 Eigen::MatrixXd computeTemporalModes(Eigen::VectorXd& eigenValueseig,
232 Eigen::MatrixXd& eigenVectoreig);
241 void getModes(Foam::PtrList<T>& spatialModes, Eigen::MatrixXd& temporalModes,
242 Eigen::MatrixXd& temporalModesSimulation, Eigen::MatrixXd& covMatrix);
250 Eigen::MatrixXd computeSimulationTemporalModes(Foam::PtrList<T>& spatialModes);
253 void compute_lambda(Eigen::MatrixXd& temporalModes);
255 const T& get_mean()
const
257 return (*f_meanField);
260 void set_b_centeredOrNot(
const Foam::label& input_b_centeredOrNot)
262 b_centeredOrNot = input_b_centeredOrNot;
270 void lift(Foam::PtrList<T>& snapshots);
271 void lift(T& snapshot);
275 void set_snapFolderParams(label nSnapshot=-1, label nSnapshotSimulation=-1, label startTime=-1, label endTime=-1)
277 if (nSnapshot != -1) {l_nSnapshot = nSnapshot;}
278 if (nSnapshotSimulation != -1) {l_nSnapshotSimulation = nSnapshotSimulation;}
279 if (startTime != -1) {l_startTime = startTime;}
280 if (endTime != -1) {l_endTime = endTime;}