Loading...
Searching...
No Matches
equalBinWidth.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::histogramModels::equalBinWidth
28
29Description
30 Histogram model which groups data into bins of equal width.
31
32Usage
33 Minimal example by using \c system/controlDict.functions:
34 \verbatim
35 histogramFO
36 {
37 // Inherited entries
38 ...
39
40 // Mandatory entries
41 nBins <label>;
42
43 // Optional entries
44 min <scalar>;
45 max <scalar>;
46 }
47 \endverbatim
48
49 where the entries mean:
50 \table
51 Property | Description | Type | Reqd | Deflt
52 nBins | Number of histogram bins | label | yes | -
53 min | Minimum value of histogram data | scalar | no | -
54 max | Maximum value of histogram data | scalar | no | -
55 \endtable
56
57Note
58 - If \c max is not provided, \c histogram will use operand
59 field's min and max as the bin extremes.
60 - If \c max is provided without \c min,
61 \c histogram will use 0 for the \c min.
62
63SourceFiles
64 equalBinWidth.C
65
66\*---------------------------------------------------------------------------*/
67
68#ifndef Foam_histogramModels_equalBinWidth_H
69#define Foam_histogramModels_equalBinWidth_H
70
71#include "histogramModel.H"
72#include "MinMax.H"
73
74// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75
76namespace Foam
77{
78namespace histogramModels
79{
80
81/*---------------------------------------------------------------------------*\
82 Class equalBinWidth Declaration
83\*---------------------------------------------------------------------------*/
84
85class equalBinWidth
86:
87 public histogramModel
88{
89 // Private Data
90
91 //- Number of bins
92 label nBins_;
93
94 //- Min/max for histogram data
95 scalarMinMax range_;
96
97
98public:
99
100 //- Runtime type information
101 TypeName("equalBinWidth");
102
103
104 // Constructors
105
106 //- Construct from components
108 (
109 const word& name,
110 const fvMesh& mesh,
111 const dictionary& dict
112 );
113
114 //- No copy construct
115 equalBinWidth(const equalBinWidth&) = delete;
116
117 //- No copy assignment
118 void operator=(const equalBinWidth&) = delete;
119
120
121 // Destructor
122 virtual ~equalBinWidth() = default;
123
124
125 // Member Functions
127 //- Read the function-object dictionary
128 virtual bool read(const dictionary& dict);
129
130 //- Write data to stream and files
131 virtual bool write(const bool log);
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace histogramModels
138} // End namespace Foam
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142#endif
143
144// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
histogramModel(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
Histogram model which groups data into bins of equal width.
equalBinWidth(const equalBinWidth &)=delete
No copy construct.
equalBinWidth(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
TypeName("equalBinWidth")
Runtime type information.
void operator=(const equalBinWidth &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition word.H:66
A namespace for various histogram model implementations.
Namespace for OpenFOAM.
MinMax< scalar > scalarMinMax
A scalar min/max range.
Definition MinMax.H:97
dimensionedScalar log(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68