Alsvinn  0.5.3
The fast FVM simulator with UQ support
Setup.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
17 #include <boost/property_tree/ptree.hpp>
20 #include "alsuq/run/Runner.hpp"
22 namespace alsuq {
23 namespace config {
24 
25 class Setup {
26 public:
27  typedef boost::property_tree::ptree ptree;
28 
43  std::shared_ptr<run::Runner> makeRunner(const std::string& inputFilename,
44  mpi::ConfigurationPtr mpiConfigurationWorld,
45  int multiSample, ivec3 multiSpatial);
46 
47 
48  std::shared_ptr<samples::SampleGenerator> makeSampleGenerator(
49  const std::string& inputFilename);
50 
51  size_t readNumberOfSamples(const std::string& inputFilename);
52 
53  size_t readSampleStart(const std::string& inputFilename);
54 
55 private:
56 
57  std::shared_ptr<samples::SampleGenerator> makeSampleGenerator(
58  ptree& configuration);
59 
60  std::vector<std::shared_ptr<stats::Statistics> > createStatistics(
61  ptree& configuration,
62  alsutils::mpi::ConfigurationPtr statisticalConfiguration,
63  mpi::ConfigurationPtr spatialConfiguration,
64  mpi::ConfigurationPtr worldConfiguration);
65  size_t readNumberOfSamples(ptree& configuration);
66  size_t readSampleStart(ptree& configuration);
67 };
68 } // namespace config
69 } // namespace alsuq
boost::property_tree::ptree ptree
Definition: Setup.hpp:27
size_t readNumberOfSamples(const std::string &inputFilename)
Definition: Setup.cpp:124
size_t readSampleStart(const std::string &inputFilename)
Definition: Setup.cpp:135
std::shared_ptr< samples::SampleGenerator > makeSampleGenerator(const std::string &inputFilename)
Definition: Setup.cpp:110
alsfvm::shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.hpp:53
std::shared_ptr< run::Runner > makeRunner(const std::string &inputFilename, mpi::ConfigurationPtr mpiConfigurationWorld, int multiSample, ivec3 multiSpatial)
Definition: Setup.cpp:53
Definition: Setup.hpp:25
Definition: Setup.hpp:22