gradingDescriptor.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::gradingDescriptor
26 
27 Description
28  Handles the specification for grading within a section of a block
29 
30  blockFraction: the fraction of the block the section occupies
31 
32  nDivFraction: the fraction of the divisions of the block allocated to
33  the section
34 
35  expansionRatio: the expansions ratio for the grading with the section of
36  block defined as the ratio of the size of the division at either and
37  of the section.
38 
39 SourceFiles
40  gradingDescriptor.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef gradingDescriptor_H
45 #define gradingDescriptor_H
46 
47 #include "scalar.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 class Istream;
55 class Ostream;
56 
57 // Forward declaration of friend functions and operators
58 class gradingDescriptor;
59 class gradingDescriptors;
60 Istream& operator>>(Istream&, gradingDescriptor&);
61 Ostream& operator<<(Ostream&, const gradingDescriptor&);
62 
63 /*---------------------------------------------------------------------------*\
64  Class gradingDescriptor Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 {
69  // Private Data
70 
71  scalar blockFraction_;
72  scalar nDivFraction_;
73  scalar expansionRatio_;
74 
75 
76 public:
77 
78  friend class gradingDescriptors;
79 
80 
81  // Constructors
82 
83  //- Default constructor
85 
86  //- Construct from components
88  (
89  const scalar blockFraction,
90  const scalar nDivFraction,
91  const scalar expansionRatio
92  );
93 
94  //- Construct from expansionRatio
96  (
97  const scalar expansionRatio
98  );
99 
100  //- Construct from Istream
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  // Access
112  scalar blockFraction() const
113  {
114  return blockFraction_;
115  }
117  scalar nDivFraction() const
118  {
119  return nDivFraction_;
120  }
122  scalar expansionRatio() const
123  {
124  return expansionRatio_;
125  }
126 
127 
128  // Member Functions
129 
130  //- Return the inverse gradingDescriptor with 1/expansionRatio
131  gradingDescriptor inv() const;
132 
133 
134  // Member Operators
135 
136  bool operator==(const gradingDescriptor&) const;
137  bool operator!=(const gradingDescriptor&) const;
138 
139 
140  // IOstream Operators
141 
143  friend Ostream& operator<<(Ostream&, const gradingDescriptor&);
144 
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
bool operator==(const gradingDescriptor &) const
gradingDescriptor inv() const
Return the inverse gradingDescriptor with 1/expansionRatio.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
gradingDescriptor()
Default constructor.
Istream & operator>>(Istream &, directionInfo &)
Handles the specification for grading within a section of a block.
~gradingDescriptor()
Destructor.
bool operator!=(const gradingDescriptor &) const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
friend Istream & operator>>(Istream &, gradingDescriptor &)
Ostream & operator<<(Ostream &, const ensightPart &)
List of gradingDescriptor for the sections of a block with additional IO functionality.
friend Ostream & operator<<(Ostream &, const gradingDescriptor &)
Namespace for OpenFOAM.