Loading...
Searching...
No Matches
POD_example_00001.cpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
35#include <array>
36#if BITPIT_ENABLE_MPI
37#include <mpi.h>
38#endif
39
40#include "pod.hpp"
41
42using namespace bitpit;
43
47void run()
48{
50 POD pod;
51
53 for (int i=0; i<6; i++)
54 pod.addSnapshot("./data", "test_set2."+std::to_string(i));
55
57 pod.setMeshType(POD::MeshType::VOLOCTREE);
58 pod.setStaticMesh(true);
59 pod.setErrorMode(POD::ErrorMode::SINGLE);
60 pod.setWriteMode(POD::WriteMode::DEBUG);
61 pod.setMemoryMode(POD::MemoryMode::MEMORY_NORMAL);
62 pod.setEnergyLevel(99);
63
64 pod.setDirectory("pod");
65 pod.setName("pod.test.solver");
66
68 pod.addReconstructionSnapshot("./data", "test_set2.0");
69
71 pod.run();
72}
73
78int main(int argc, char *argv[])
79{
80#if BITPIT_ENABLE_MPI
81 MPI_Init(&argc,&argv);
82#endif
83
85 try {
86 run();
87 } catch (const std::exception &exception) {
88 log::cout() << exception.what();
89 exit(1);
90 }
91
92#if BITPIT_ENABLE_MPI
93 MPI_Finalize();
94#endif
95
96}
The POD (Proper Orthogonal Decomposition) class provides an interface for defining POD object.
Definition pod.hpp:41
void run()
Definition pod.cpp:836
void setMeshType(MeshType type)
Definition pod.cpp:390
void setStaticMesh(bool flag)
Definition pod.cpp:483
void setMemoryMode(MemoryMode mode)
Definition pod.cpp:505
void setDirectory(const std::string &directory)
Definition pod.cpp:180
void addReconstructionSnapshot(const std::string &directory, const std::string &name)
Definition pod.cpp:282
void setWriteMode(WriteMode mode)
Definition pod.cpp:576
void setEnergyLevel(double energy)
Definition pod.cpp:326
void setName(const std::string &name)
Definition pod.cpp:160
void setErrorMode(ErrorMode mode)
Definition pod.cpp:635
void addSnapshot(const std::string &directory, const std::string &name)
Definition pod.cpp:208
Logger & cout(log::Level defaultSeverity, log::Visibility defaultVisibility)
Definition logger.cpp:1705
--- layout: doxygen_footer ---