The open source CFD toolbox
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) 2015 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
29
30Description
31 Handles the specification for grading within a section of a block
32
33 The grading specification is handled is controlled by three parameters:
34
35 - blockFraction: the fraction of the block the section occupies
36
37 - nDivFraction: the fraction of the divisions of the block allocated to
38 the section
39
40 - expansionRatio:
41 the expansion ratio for the grading with the section of
42 block defined as the ratio of end-size / start-size for the section.
43 A negative value is trapped and treated as its inverse.
44
45SourceFiles
47
48\*---------------------------------------------------------------------------*/
49
52
53#include "scalar.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60// Forward Declarations
61class Istream;
62class Ostream;
65
68
69/*---------------------------------------------------------------------------*\
71\*---------------------------------------------------------------------------*/
74{
75 // Private Data
76
77 scalar blockFraction_;
78 scalar nDivFraction_;
79 scalar expansionRatio_;
80
81
82public:
83
86
87
88 // Constructors
89
90 //- Default construct (1, 1, 1)
92
93 //- Construct from components
95 (
96 const scalar blockFraction,
97 const scalar nDivFraction,
98 const scalar expansionRatio
99 );
100
101 //- Construct from expansionRatio
103
104 //- Construct from Istream
106
107
108 //- Destructor
110
111
112 // Member Functions
114 scalar blockFraction() const
115 {
116 return blockFraction_;
117 }
119 scalar nDivFraction() const
120 {
121 return nDivFraction_;
122 }
124 scalar expansionRatio() const
125 {
126 return expansionRatio_;
127 }
128
130 // Trap negative value and treat as its inverse.
131 void correct();
132
133 //- Return the inverse gradingDescriptor with 1/expansionRatio
135
136
137 // Member Operators
138
141
142
143 // IOstream Operators
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#endif
157
158// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Handles the specification for grading within a section of a block.
void correct()
Destructor.
friend Istream & operator>>(Istream &, gradingDescriptor &)