Alsvinn  0.5.3
The fast FVM simulator with UQ support
Runner.hpp
Go to the documentation of this file.
1 /* Copyright (c) 2018 ETH Zurich, Kjetil Olsen Lye
2  * This program is free software: you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #pragma once
20 
21 namespace alsuq {
22 namespace run {
23 
24 class Runner {
25 public:
26  Runner(std::shared_ptr<SimulatorCreator> simulatorCreator,
27  std::shared_ptr<samples::SampleGenerator> sampleGenerator,
28  std::vector<size_t> sampleNumbers,
29  mpi::ConfigurationPtr mpiConfig,
30  const std::string& name);
31 
32 
33 
34 
35  void run();
36 
37 
39  void setStatistics(const std::vector<std::shared_ptr<stats::Statistics> >&
40  statistics);
41  std::string getName() const;
42 
43  size_t getTimestepsPerformedTotal() const;
44 
45 private:
46  std::shared_ptr<SimulatorCreator> simulatorCreator;
47  std::shared_ptr<samples::SampleGenerator> sampleGenerator;
48  std::vector<std::string> parameterNames;
49  std::vector<size_t> sampleNumbers;
50  std::vector<std::shared_ptr<stats::Statistics> > statistics;
51 
52  mpi::ConfigurationPtr mpiConfig;
53  const std::string name;
54  size_t timestepsPerformedTotal = 0;
55 };
56 } // namespace run
57 } // namespace alsuq
std::string getName() const
Definition: Runner.cpp:98
Definition: Runner.hpp:24
size_t getTimestepsPerformedTotal() const
Definition: Runner.cpp:102
alsfvm::shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.hpp:53
Runner(std::shared_ptr< SimulatorCreator > simulatorCreator, std::shared_ptr< samples::SampleGenerator > sampleGenerator, std::vector< size_t > sampleNumbers, mpi::ConfigurationPtr mpiConfig, const std::string &name)
Definition: Runner.cpp:23
void setStatistics(const std::vector< std::shared_ptr< stats::Statistics > > &statistics)
Sets the statistics to be used.
Definition: Runner.cpp:93
void run()
Definition: Runner.cpp:39
Definition: Setup.hpp:22