Loading...
Searching...
No Matches
unequalBinWidth.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::unequalBinWidth
28
29Description
30 Histogram model which groups data into bins of unequal widths.
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 ranges
42 (
43 // min max
44 (<scalar> <scalar>) // bin-0
45 (<scalar> <scalar>) // bin-1
46 ...
47 );
48 }
49 \endverbatim
50
51 where the entries mean:
52 \table
53 Property | Description | Type | Reqd | Deflt
54 ranges | Min-max values of histogram data <!--
55 --> | List<scalarMinMax> | no | -
56 \endtable
57
58Note
59 - All bins are half-open, that is [min, max).
60 - Bins should be specified as consecutive, non-overlapping
61 and adjacent intervals of the field variable. No warning
62 or runtime error will be emitted, otherwise.
63
64SourceFiles
65 unequalBinWidth.C
66
67\*---------------------------------------------------------------------------*/
68
69#ifndef Foam_histogramModels_unequalBinWidth_H
70#define Foam_histogramModels_unequalBinWidth_H
71
72#include "histogramModel.H"
73#include "MinMax.H"
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77namespace Foam
78{
79namespace histogramModels
80{
81
82/*---------------------------------------------------------------------------*\
83 Class unequalBinWidth Declaration
84\*---------------------------------------------------------------------------*/
85
87:
88 public histogramModel
89{
90 // Private Data
91
92 //- Number of bins
93 label nBins_;
94
95 //- Lower and upper ranges of operand bins
96 List<scalarMinMax> ranges_;
97
98
99public:
100
101 //- Runtime type information
102 TypeName("unequalBinWidth");
103
104
105 // Constructors
106
107 //- Construct from components
109 (
110 const word& name,
111 const fvMesh& mesh,
112 const dictionary& dict
113 );
114
115 //- No copy construct
116 unequalBinWidth(const unequalBinWidth&) = delete;
118 //- No copy assignment
119 void operator=(const unequalBinWidth&) = delete;
120
121
122 // Destructor
123 virtual ~unequalBinWidth() = default;
124
125
126 // Member Functions
127
128 //- Read the function-object dictionary
129 virtual bool read(const dictionary& dict);
130
131 //- Write data to stream and files
132 virtual bool write(const bool log);
133};
134
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138} // End namespace histogramModels
139} // End namespace Foam
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143#endif
145// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
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 unequal widths.
unequalBinWidth(const unequalBinWidth &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
unequalBinWidth(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
void operator=(const unequalBinWidth &)=delete
No copy assignment.
TypeName("unequalBinWidth")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition word.H:66
A namespace for various histogram model implementations.
Namespace for OpenFOAM.
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