Alsvinn  0.5.3
The fast FVM simulator with UQ support
TimeIntegratedWriter.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"
19 
20 #include <memory>
21 
22 namespace alsfvm {
23 namespace io {
24 
32 class TimeIntegratedWriter : public Writer {
33 public:
39  TimeIntegratedWriter(alsfvm::shared_ptr<Writer>& writer, real time,
40  real timeRadius);
41 
42  virtual ~TimeIntegratedWriter() {}
49  virtual void write(const volume::Volume& conservedVariables,
50  const grid::Grid& grid,
51  const simulator::TimestepInformation& timestepInformation) override;
52 
53 
55  virtual void finalize(const grid::Grid& grid,
56  const simulator::TimestepInformation& timestepInformation) override;
57 private:
58  alsfvm::shared_ptr<Writer> writer;
59  const real time;
60  const real timeRadius;
61 
62  real lastTime = 0;
63  bool written = false;
64  alsfvm::shared_ptr<volume::Volume> integratedConservedVariables;
65 };
66 } // namespace alsfvm
67 } // namespace io
virtual ~TimeIntegratedWriter()
Definition: TimeIntegratedWriter.hpp:42
TimeIntegratedWriter(alsfvm::shared_ptr< Writer > &writer, real time, real timeRadius)
Definition: TimeIntegratedWriter.cpp:21
virtual void write(const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
write writes the data to disk
Definition: TimeIntegratedWriter.cpp:28
Definition: Grid.hpp:27
The TimeIntegratedWriter class is a decorator for another writer. Its purpose is to only call the und...
Definition: TimeIntegratedWriter.hpp:32
The Volume class represents a volume (a collection of cells with values for each cell (eg...
Definition: Volume.hpp:30
double real
Definition: types.hpp:65
virtual void finalize(const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
This method should be called at the end of the simulation.
Definition: TimeIntegratedWriter.cpp:68
const grid::Grid & grid
Definition: NumericalFluxFactory.cpp:104
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
Definition: TimestepInformation.hpp:22