Alsvinn  0.5.3
The fast FVM simulator with UQ support
TimeIntegrationFunctional.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/io/Writer.hpp"
21 
22 namespace alsfvm {
23 namespace functional {
24 
38 public:
39 
41  io::WriterPointer writer,
42  FunctionalPointer functional,
43  double time,
44  double timeRadius);
45 
46  virtual void write(const volume::Volume& conservedVariables,
47  const grid::Grid& grid,
48  const simulator::TimestepInformation& timestepInformation) override;
49 
50  virtual void finalize(const grid::Grid& grid,
51  const simulator::TimestepInformation& timestepInformation) override;
52 
53 private:
54  void makeVolumes(const grid::Grid& grid, const volume::Volume& volume);
55  volume::VolumeFactory volumeFactory;
56  io::WriterPointer writer;
57  FunctionalPointer functional;
58 
59  volume::VolumePointer conservedVolume;
60 
61  const double time;
62  const double timeRadius;
63  double lastTime = 0;
64 
65  ivec3 functionalSize;
66 
67 };
68 } // namespace functional
69 } // namespace alsfvm
Definition: Grid.hpp:27
Definition: VolumeFactory.hpp:29
The Volume class represents a volume (a collection of cells with values for each cell (eg...
Definition: Volume.hpp:30
virtual void finalize(const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
This method should be called at the end of the simulation.
Definition: TimeIntegrationFunctional.cpp:51
TimeIntegrationFunctional(volume::VolumeFactory volumeFactory, io::WriterPointer writer, FunctionalPointer functional, double time, double timeRadius)
Definition: TimeIntegrationFunctional.cpp:22
alsfvm::shared_ptr< Volume > VolumePointer
Definition: Volume.hpp:345
const grid::Grid & grid
Definition: NumericalFluxFactory.cpp:104
Definition: TimeIntegrationFunctional.hpp:37
alsfvm::shared_ptr< Functional > FunctionalPointer
Definition: Functional.hpp:74
The Writer class is an abstract interface to represent output writers.
Definition: Writer.hpp:28
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
virtual void write(const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
write writes the data to disk
Definition: TimeIntegrationFunctional.cpp:33
functional
Definition: FunctionalStatistics.cpp:76
alsfvm::shared_ptr< Writer > WriterPointer
Definition: Writer.hpp:64
Definition: TimestepInformation.hpp:22