102# if BITPIT_ENABLE_MPI
103 POD(MPI_Comm comm = MPI_COMM_WORLD);
120 void setName(
const std::string &name);
122 void addSnapshot(
const std::string &directory,
const std::string &name);
124 void setSnapshots(
const std::vector<pod::SnapshotFile> &database);
137 void setTargetErrorFields(std::vector<std::string> &namesf, std::vector<std::array<std::string,3>> &namevf);
140 void setMesh(
const std::string &directory,
const std::string &name);
142 void setMesh(std::unique_ptr<VolumeKernel> &&mesh);
168 const std::vector<pod::PODMode> &
getModes();
172 std::unique_ptr<PODKernel> &
getKernel();
190 void adaptionAlter(
const std::vector<adaption::Info> & info);
199 std::map<std::string, std::size_t> targetFields,
200 const std::unordered_set<long> *targetCells);
210 void write(
int mode_index, std::string file_name);
213 std::unique_ptr<PODKernel> m_podkernel;
217 std::string m_directory;
219 std::vector<pod::SnapshotFile> m_database;
220 std::vector<pod::SnapshotFile> m_reconstructionDatabase;
221 std::vector<pod::SnapshotFile> m_leave1outOffDatabase;
222 std::size_t m_nSnapshots;
223 std::size_t m_nReconstructionSnapshots;
224 std::size_t m_nScalarFields;
225 std::size_t m_nVectorFields;
226 std::size_t m_nFields;
227 std::vector<std::string> m_nameScalarFields;
228 std::vector<std::array<std::string,3>> m_nameVectorFields;
229 std::map<std::string, std::size_t> m_nameTargetErrorFields;
235 std::vector<pod::PODMode> m_modes;
236 std::size_t m_nModes;
237 double m_energyLevel;
238 double m_errorThreshold;
240 std::vector<std::vector<double>> m_correlationMatrices;
241 std::vector<std::vector<double>> m_minimizationMatrices;
242 std::vector<std::vector<double>> m_lambda;
243 std::vector<std::vector<std::vector<double>>> m_podCoeffs;
244 std::vector<std::vector<double>> m_reconstructionCoeffs;
246 std::unordered_set<long int> m_listActiveIDs;
247 std::vector<std::size_t> m_listActiveIDsLeave1out;
248 std::size_t m_sizeInternal;
251 MPI_Comm m_communicator;
266 std::vector<std::size_t> _m_nr;
268 const static int ARCHIVE_VERSION = 0;
270 const double ENERGY_CHECK_TOLERANCE = 1.0e-12;
272 void _evalMeanMesh();
273 void checkModeCount(
double *alambda, std::size_t ifield);
275 void initCorrelation();
277 void initErrorMaps();
279 void evalMinimizationMatrices();
280 void initMinimization();
281 void solveMinimization(std::vector<std::vector<double>> &rhs);
283 void dumpMode(std::size_t ir);
285 void readMode(std::size_t ir);
287 double getCellVolume(
long id);
288 double getRawCellVolume(
long rawIndex);
294 void initializeCommunicator(MPI_Comm communicator);
295 MPI_Comm getCommunicator()
const;
296 bool isCommunicatorSet()
const;
297 void freeCommunicator();
302 const std::vector<std::size_t> &scalarIds,
const std::vector<std::size_t> &podscalarIds,
303 const std::vector<std::array<std::size_t, 3>> &vectorIds,
const std::vector<std::size_t> &podvectorIds);
304 void buildFields(
const std::vector<std::vector<double>> &reconstructionCoeffs,
pod::PODField &recon);
305 void buildFields(
const std::vector<std::vector<double>> &reconstructionCoeffs,
PiercedStorage<double> &fields,
306 const std::vector<std::size_t> &scalarIds,
const std::vector<std::size_t> &podscalarIds,
307 const std::vector<std::array<std::size_t, 3>> &vectorIds,
const std::vector<std::size_t> &podvectorIds,
308 const std::unordered_set<long> *targetCells =
nullptr);
311 void _adaptionAlter(
const std::vector<adaption::Info> & info);
314 const std::vector<std::size_t> &scalarIds,
const std::vector<std::size_t> &podscalarIds,
315 const std::vector<std::array<std::size_t, 3>> &vectorIds,
const std::vector<std::size_t> &podvectorIds,
316 const std::unordered_set<long> *targetCells =
nullptr);
318 const std::vector<std::size_t> &scalarIds,
const std::vector<std::size_t> &podscalarIds,
319 const std::vector<std::array<std::size_t, 3>> &vectorIds,
const std::vector<std::size_t> &podvectorIds,
320 const std::unordered_set<long> *targetCells =
nullptr);