Alsvinn  0.5.3
The fast FVM simulator with UQ support
NumericalFluxCPU.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
18 #include "alsfvm/grid/Grid.hpp"
23 
24 namespace alsfvm {
25 namespace numflux {
26 
33 template<class Flux, class Equation, size_t dimension>
35 public:
36 
38  alsfvm::shared_ptr<reconstruction::Reconstruction>& reconstruction,
39  const alsfvm::shared_ptr<simulator::SimulatorParameters>& simulatorParameters,
40  alsfvm::shared_ptr<DeviceConfiguration>& deviceConfiguration
41  );
42 
59  virtual void computeFlux(const volume::Volume& conservedVariables,
60  rvec3& waveSpeed, bool computeWaveSpeed,
61  volume::Volume& output, const ivec3& start = {0, 0, 0},
62  const ivec3& end = {0, 0, 0}
63  );
64 
65 
69  virtual size_t getNumberOfGhostCells();
70 
71 private:
72 
73  void createVolumes(size_t nx, size_t ny, size_t nz, size_t ngc);
74  volume::VolumeFactory volumeFactory;
75  alsfvm::shared_ptr<reconstruction::Reconstruction> reconstruction;
76  alsfvm::shared_ptr<volume::Volume> left;
77  alsfvm::shared_ptr<volume::Volume> right;
78 
79  // This is for storing F(U_l, U_r) at each cell
80  alsfvm::shared_ptr<volume::Volume> temporaryVolume;
81 
82  typename Equation::Parameters parameters;
83 };
84 
85 } // namespace alsfvm
86 } // namespace numflux
87 
alsfvm::shared_ptr< DeviceConfiguration > & deviceConfiguration
Definition: NumericalFluxFactory.cpp:103
Definition: Grid.hpp:27
const alsfvm::shared_ptr< simulator::SimulatorParameters > & simulatorParameters
Definition: NumericalFluxFactory.cpp:102
Definition: VolumeFactory.hpp:29
The Volume class represents a volume (a collection of cells with values for each cell (eg...
Definition: Volume.hpp:30
Definition: NumericalFlux.hpp:25
Definition: NumericalFluxCPU.hpp:34
size_t nx
Definition: VolumeFactory.cpp:87
virtual void computeFlux(const volume::Volume &conservedVariables, rvec3 &waveSpeed, bool computeWaveSpeed, volume::Volume &output, const ivec3 &start={0, 0, 0}, const ivec3 &end={0, 0, 0})
Definition: NumericalFluxCPU.cpp:171
size_t ny
Definition: VolumeFactory.cpp:88
const grid::Grid & grid
Definition: NumericalFluxFactory.cpp:104
NumericalFluxCPU(const grid::Grid &grid, alsfvm::shared_ptr< reconstruction::Reconstruction > &reconstruction, const alsfvm::shared_ptr< simulator::SimulatorParameters > &simulatorParameters, alsfvm::shared_ptr< DeviceConfiguration > &deviceConfiguration)
Definition: NumericalFluxCPU.cpp:149
size_t nz
Definition: VolumeFactory.cpp:89
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
alsutils::parameters::Parameters Parameters
Definition: Parameters.hpp:24
virtual size_t getNumberOfGhostCells()
Definition: NumericalFluxCPU.cpp:227