Alsvinn  0.5.3
The fast FVM simulator with UQ support
make_volume.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 "alsfvm/volume/Volume.hpp"
19 
20 namespace alsfvm {
21 namespace volume {
23 inline alsfvm::shared_ptr<Volume> makeConservedVolume(const std::string&
24  platform,
25  const std::string& equation,
26  const ivec3& innerSize,
27  const int ghostCells) {
28 
29  alsfvm::shared_ptr<DeviceConfiguration> deviceConfiguration(
30  new DeviceConfiguration(platform));
31 
32  auto memoryFactory = alsfvm::make_shared<memory::MemoryFactory>
34 
35  VolumeFactory factory(equation, memoryFactory);
36 
37  return factory.createConservedVolume(innerSize.x, innerSize.y, innerSize.z,
38  ghostCells);
39 }
40 
42 inline alsfvm::shared_ptr<Volume> makeExtraVolume(const std::string& platform,
43  const std::string& equation,
44  const ivec3& innerSize,
45  const int ghostCells) {
46 
47  alsfvm::shared_ptr<DeviceConfiguration> deviceConfiguration(
48  new DeviceConfiguration(platform));
49 
50  auto memoryFactory = alsfvm::make_shared<memory::MemoryFactory>
52 
53  VolumeFactory factory(equation, memoryFactory);
54 
55  return factory.createExtraVolume(innerSize.x, innerSize.y, innerSize.z,
56  ghostCells);
57 }
58 }
59 }
T z
Definition: vec3.hpp:28
alsfvm::shared_ptr< memory::MemoryFactory > memoryFactory
Definition: VolumeFactory.cpp:86
alsfvm::shared_ptr< DeviceConfiguration > & deviceConfiguration
Definition: NumericalFluxFactory.cpp:103
Definition: VolumeFactory.hpp:29
Definition: vec3.hpp:25
alsfvm::shared_ptr< Volume > makeConservedVolume(const std::string &platform, const std::string &equation, const ivec3 &innerSize, const int ghostCells)
Convenience function meant to be used for testing, NOT in production.
Definition: make_volume.hpp:23
Definition: DeviceConfiguration.hpp:19
alsfvm::shared_ptr< Volume > makeExtraVolume(const std::string &platform, const std::string &equation, const ivec3 &innerSize, const int ghostCells)
Convenience function meant to be used for testing, NOT in production.
Definition: make_volume.hpp:42
T y
Definition: vec3.hpp:27
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
T x
Definition: vec3.hpp:26