OpenLB 1.8.1
Loading...
Searching...
No Matches
gnuplotHeatMapWriter.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017 Marc Haussmann
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef GNUPLOT_HEATMAP_WRITER_H
25#define GNUPLOT_HEATMAP_WRITER_H
26
27#include <iomanip>
28#include <iostream>
29#include <list>
30
34
35namespace olb {
36
37namespace heatmap {
38
39template <typename T>
40struct plotParam {
41 std::string name;
42 bool writeCSV = false;
43 bool fullScreenPlot = false;
45 int contourlevel = 0;
46 std::string colour = std::string("rainbow");
49 T minValue = 0.;
50 T maxValue = 0.;
51
53 zoomOrigin(0.0, 0.0),
54 zoomExtend(1.0, 1.0)
55 {
56 }
57
58};
59
60namespace detail {
61
62template <typename T>
63void genericHeatMapInterface(const HyperplaneLattice3D<T>& hyperPlane, BlockF2D<T>& blockData, int iT,
64 const std::vector<T>& valueArea, const plotParam<T>& param);
65
66
67
68template <typename T>
93
94template <typename T>
96
97template <typename T>
98void writeHeatMapPlotFile(detailParam<T>& param, const std::vector<T>& valueArea);
99
100template< typename T >
101void executeGnuplot(detailParam<T>& param);
102
103bool gnuplotInstalled();
104
105} // namespace detail
106
114template <typename T>
115void write(BlockReduction3D2D<T>& blockReduction, int iT, const plotParam<T> param = {}, const std::vector<T>& valueArea = std::vector<T>{}) {
116 detail::genericHeatMapInterface<T>(blockReduction, blockReduction, iT, valueArea, param);
117}
118
119template <typename T>
120void write(BlockReduction2D2D<T>& blockReduction, int iT, const plotParam<T> param = {}, const std::vector<T>& valueArea = std::vector<T>{}) {
121 detail::genericHeatMapInterface<T>(blockReduction.getPlaneDiscretizationIn3D(), blockReduction, iT,
122 valueArea, param);
123}
124
125template <typename T, typename DESCRIPTOR, typename FUNCTOR>
126void write(EfficientBlockReduction3D2D<T,DESCRIPTOR,FUNCTOR>& blockReduction, int iT, const plotParam<T> param = {}, const std::vector<T>& valueArea = std::vector<T>{}) {
127 detail::genericHeatMapInterface<T>(blockReduction, blockReduction, iT, valueArea, param);
128}
129
130} // namespace heatmap
131
132} // namespace olb
133
134#endif
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
Definition aliases.h:173
BlockReduction2D2D interpolates the data of a SuperF2D functor in a given resolution.
HyperplaneLattice3D< T > getPlaneDiscretizationIn3D() const
Returns embedding of the discretized plane in 3D space.
BlockReduction3D2D reduces the data of a SuperF3D functor to the intersection between a given hyperpl...
Parametrization of a hyperplane lattice.
Plain old scalar vector.
void writeHeatMapDataFile(detailParam< T > &param)
void genericHeatMapInterface(const HyperplaneLattice3D< T > &hyperPlane, BlockF2D< T > &blockData, int iT, const std::vector< T > &valueArea, const plotParam< T > &param)
void executeGnuplot(detailParam< T > &param)
void writeHeatMapPlotFile(detailParam< T > &param, const std::vector< T > &valueArea)
void write(BlockReduction3D2D< T > &blockReduction, int iT, const plotParam< T > param={}, const std::vector< T > &valueArea=std::vector< T >{})
This function is used to plot heat maps as jpeg files.
Top level namespace for all of OpenLB.
const HyperplaneLattice3D< T > * hyperPlane