OpenLB 1.7
Loading...
Searching...
No Matches
superGeometryStatistics3D.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_3D_H
29#define SUPER_GEOMETRY_STATISTICS_3D_H
30
31
32#include <map>
33#include <string>
34#include <vector>
35
38#include "io/ostreamManager.h"
39
40
41// All OpenLB code is contained in this namespace.
42namespace olb {
43
45
53template<typename T, unsigned D>
54class SuperGeometry;
55
56template<typename T>
58private:
60 const SuperGeometry<T,3>* _superGeometry;
62 bool _statisticsUpdateNeeded;
63
65 int _nMaterials;
67 std::map<int, std::size_t> _material2n;
69 std::map<int, olb::Vector<T, 3> > _material2min;
71 std::map<int, olb::Vector<T, 3> > _material2max;
73 olb::Vector<T, 3> _minOverMaterial;
75 olb::Vector<T, 3> _maxOverMaterial;
76
78 mutable OstreamManager clout;
79
80 const SuperGeometryStatistics3D<T>* const_this;
81
82public:
83
90
92 bool& getStatisticsStatus();
94 bool const & getStatisticsStatus() const;
95
97 void update(bool verbose=false);
98
100 int getNmaterials();
101 int getNmaterials() const;
103 std::size_t getNvoxel(int material);
104 std::size_t getNvoxel(int material) const;
106 std::size_t getNvoxel();
107 std::size_t getNvoxel() const;
109 olb::Vector<T, 3>getMinPhysR(int material);
110 olb::Vector<T, 3>getMinPhysR(int material) const;
115 olb::Vector<T, 3> getMaxPhysR(int material);
116 olb::Vector<T, 3> getMaxPhysR(int material) const;
121 olb::Vector<T, 3> getPhysExtend(int material);
122 std::vector<T> getPhysExtend(int material) const;
124 olb::Vector<T, 3> getPhysRadius(int material);
125 olb::Vector<T, 3> getPhysRadius(int material) const;
127 olb::Vector<T, 3> getCenterPhysR(int material);
128 olb::Vector<T, 3> getCenterPhysR(int material) const;
130 olb::Vector<int, 3> getType(int iC, int iX, int iY, int iZ);
131 olb::Vector<int, 3> getType(int iC, int iX, int iY, int iZ) const;
132
134 olb::Vector<T, 3> computeNormal (int material);
135 olb::Vector<T, 3> computeNormal (int material) const;
138 olb::Vector<int, 3> computeDiscreteNormal (int material, T maxNorm = 1.1);
139 olb::Vector<int, 3> computeDiscreteNormal (int material, T maxNorm = 1.1) const;
141 T computeMaxPhysDistance(int material ) const;
143 T computeMaxPhysDistance() const;
145 void print();
146 void print() const;
147};
148
149} // namespace olb
150
151#endif
152
class for marking output with some text
olb::Vector< T, 3 > 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...
olb::Vector< T, 3 > getMinPhysR()
Returns the min. phys position in each direction corresponding to all non-zero material numbers.
void update(bool verbose=false)
Updates the statistics if it is really needed.
olb::Vector< T, 3 > getMaxPhysR()
Returns the max. phys position in each direction corresponding to all non-zero material numbers.
olb::Vector< int, 3 > getType(int iC, int iX, int iY, int iZ)
Returns the boundary type which is characterized by a discrte normal (c.f. Zimny)
std::size_t getNvoxel()
Returns the number of voxels with material!=0.
olb::Vector< T, 3 > computeNormal(int material)
Returns normal that points into the fluid for paraxial surfaces.
int getNmaterials()
Returns the number of different materials.
SuperGeometryStatistics3D< T > & operator=(SuperGeometryStatistics3D const &rhs)
Copy assignment.
olb::Vector< int, 3 > computeDiscreteNormal(int material, T maxNorm=1.1)
Returns discrete normal with norm maxNorm that points into the fluid for paraxial surfaces maxNorm=1....
bool & getStatisticsStatus()
Read and write access to a flag, which indicates if an uptate is needed (=true)
olb::Vector< T, 3 > getPhysExtend(int material)
Returns the phys extend as length in each direction.
SuperGeometryStatistics3D(SuperGeometry< T, 3 > *superGeometry)
Constructor.
T computeMaxPhysDistance() const
Returns util::sqrt( maxX^2 + maxY^2 + maxZ^2 ) max over all material numbers.
olb::Vector< T, 3 > getPhysRadius(int material)
Returns the phys radius as length in each direction.
Representation of a statistic for a parallel 2D geometry.
Plain old scalar vector.
Definition vector.h:47
Wrapper functions that simplify the use of MPI.
Top level namespace for all of OpenLB.
Representation of a parallel 2D geometry – header file.