OpenLB 1.7
Loading...
Searching...
No Matches
superGeometryStatistics2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2013, 2014 Mathias J. Krause
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
28#ifndef SUPER_GEOMETRY_STATISTICS_2D_H
29#define SUPER_GEOMETRY_STATISTICS_2D_H
30
31
32#include <map>
33#include <string>
34#include <vector>
35
37#include "io/ostreamManager.h"
38
39
40// All OpenLB code is contained in this namespace.
41namespace olb {
42
44
52template<typename T, unsigned D>
53class SuperGeometry;
54
55template<typename T>
57private:
59 const SuperGeometry<T,2>* _superGeometry;
61 bool _statisticsUpdateNeeded;
62
64 int _nMaterials;
66 std::map<int, int> _material2n;
68 std::map<int, std::vector<T> > _material2min;
70 std::map<int, std::vector<T> > _material2max;
71
73 mutable OstreamManager clout;
74
75 const SuperGeometryStatistics2D<T>* const_this;
76
77public:
78
85
87 bool& getStatisticsStatus();
89 bool const & getStatisticsStatus() const;
90
92 void update(bool verbose=false);
93
95 int getNmaterials();
96 int getNmaterials() const;
98 int getNvoxel(int material);
99 int getNvoxel(int material) const;
101 int getNvoxel();
102 int getNvoxel() const;
104 std::vector<T> getMinPhysR(int material);
105 std::vector<T> getMinPhysR(int material) const;
107 std::vector<T> getMaxPhysR(int material);
108 std::vector<T> getMaxPhysR(int material) const;
110 std::vector<T> getPhysExtend(int material);
111 std::vector<T> getPhysExtend(int material) const;
113 std::vector<T> getPhysRadius(int material);
114 std::vector<T> getPhysRadius(int material) const;
116 std::vector<T> getCenterPhysR(int material);
117 std::vector<T> getCenterPhysR(int material) const;
119 std::vector<int> getType(int iC, int iX, int iY);
120 std::vector<int> getType(int iC, int iX, int iY) const;
121
123 std::vector<T> computeNormal (int material);
124 std::vector<T> computeNormal (int material) const;
127 std::vector<int> computeDiscreteNormal (int material, T maxNorm = 1.1);
128 std::vector<int> computeDiscreteNormal (int material, T maxNorm = 1.1) const;
129
131 void print();
132 void print() const;
133};
134
135} // namespace olb
136
137#endif
138
class for marking output with some text
int getNvoxel()
Returns the number of voxels with material!=0.
std::vector< T > getPhysExtend(int material)
Returns the phys extend as length in each direction.
std::vector< int > getType(int iC, int iX, int iY)
Returns the boundary type which is characterized by a discrte normal (c.f. Zimny)
std::vector< int > computeDiscreteNormal(int material, T maxNorm=1.1)
Returns discrete normal with norm maxNorm that points into the fluid for paraxial surfaces maxNorm=1....
std::vector< T > getPhysRadius(int material)
Returns the phys radius as length in each direction.
std::vector< T > getCenterPhysR(int material)
Returns the center position.
void print()
Prints some statistic information, i.e. the number of voxels and min. max. physical position for each...
SuperGeometryStatistics2D< T > & operator=(SuperGeometryStatistics2D const &rhs)
Copy assignment.
void update(bool verbose=false)
Updates the statistics if it is really needed.
std::vector< T > getMinPhysR(int material)
Returns the min. phys position in each direction.
int getNmaterials()
Returns the number of different materials.
std::vector< T > getMaxPhysR(int material)
Returns the max. phys position in each direction.
std::vector< T > computeNormal(int material)
Returns normal that points into the fluid for paraxial surfaces.
SuperGeometryStatistics2D(SuperGeometry< T, 2 > *superGeometry)
Constructor.
bool & getStatisticsStatus()
Read and write access to a flag, which indicates if an uptate is needed (=true)
Representation of a statistic for a parallel 2D geometry.
Top level namespace for all of OpenLB.
Representation of a parallel 2D geometry – header file.