geometricSurfacePatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation, either version 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::geometricSurfacePatch
26 
27 Description
28  The geometricSurfacePatch is like patchIdentifier but for surfaces.
29  Holds type, name and index.
30 
31 SourceFiles
32  geometricSurfacePatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef geometricSurfacePatch_H
37 #define geometricSurfacePatch_H
38 
39 #include "word.H"
40 #include "label.H"
41 #include "typeInfo.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class dictionary;
49 
50 /*---------------------------------------------------------------------------*\
51  Class geometricSurfacePatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private data
57 
58  //- Type name of patch
60 
61  //- Name of patch
62  word name_;
63 
64  //- Index of patch in boundary
65  label index_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  ClassName("geometricSurfacePatch");
72 
73 
74  // Constructors
75 
76  //- Construct null
78 
79  //- Construct from components
81  (
82  const word& geometricType,
83  const word& name,
84  const label index
85  );
86 
87  //- Construct from Istream
89 
90  //- Construct from dictionary
92  (
93  const word& name,
94  const dictionary& dict,
95  const label index
96  );
97 
98 
99  // Member Functions
100 
101  //- Return name
102  const word& name() const
103  {
104  return name_;
105  }
106 
107  //- Return name
108  word& name()
109  {
110  return name_;
111  }
112 
113  //- Return the type of the patch
114  const word& geometricType() const
115  {
116  return geometricType_;
117  }
118 
119  //- Return the type of the patch
121  {
122  return geometricType_;
123  }
124 
125  //- Return the index of this patch in the boundaryMesh
126  label index() const
127  {
128  return index_;
129  }
130 
131  //- Return the index of this patch in the boundaryMesh
132  label& index()
133  {
134  return index_;
135  }
136 
137  //- Write
138  void write(Ostream&) const;
139 
140  //- Write dictionary
141  void writeDict(Ostream&) const;
142 
143 
144  // Member Operators
145 
146  bool operator!=(const geometricSurfacePatch&) const;
147 
148  //- compare.
149  bool operator==(const geometricSurfacePatch&) const;
150 
151 
152  // Ostream Operator
153 
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::geometricSurfacePatch::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: geometricSurfacePatch.H:125
Foam::geometricSurfacePatch::name
word & name()
Return name.
Definition: geometricSurfacePatch.H:107
Foam::geometricSurfacePatch::operator!=
bool operator!=(const geometricSurfacePatch &) const
Definition: geometricSurfacePatch.C:120
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
typeInfo.H
Foam::geometricSurfacePatch::writeDict
void writeDict(Ostream &) const
Write dictionary.
Definition: geometricSurfacePatch.C:112
Foam::geometricSurfacePatch
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index.
Definition: geometricSurfacePatch.H:53
Foam::geometricSurfacePatch::geometricSurfacePatch
geometricSurfacePatch()
Construct null.
Definition: geometricSurfacePatch.C:41
Foam::geometricSurfacePatch::geometricType_
word geometricType_
Type name of patch.
Definition: geometricSurfacePatch.H:58
Foam::geometricSurfacePatch::operator<<
friend Ostream & operator<<(Ostream &, const geometricSurfacePatch &)
Definition: geometricSurfacePatch.C:148
Foam::geometricSurfacePatch::index_
label index_
Index of patch in boundary.
Definition: geometricSurfacePatch.H:64
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::geometricSurfacePatch::geometricType
const word & geometricType() const
Return the type of the patch.
Definition: geometricSurfacePatch.H:113
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::geometricSurfacePatch::name_
word name_
Name of patch.
Definition: geometricSurfacePatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::geometricSurfacePatch::ClassName
ClassName("geometricSurfacePatch")
Runtime type information.
Foam::geometricSurfacePatch::index
label & index()
Return the index of this patch in the boundaryMesh.
Definition: geometricSurfacePatch.H:131
Foam::geometricSurfacePatch::operator==
bool operator==(const geometricSurfacePatch &) const
compare.
Definition: geometricSurfacePatch.C:127
Foam::geometricSurfacePatch::operator>>
friend Istream & operator>>(Istream &, geometricSurfacePatch &)
Definition: geometricSurfacePatch.C:140
label.H
Foam::geometricSurfacePatch::write
void write(Ostream &) const
Write.
Definition: geometricSurfacePatch.C:105
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
word.H
Foam::geometricSurfacePatch::geometricType
word & geometricType()
Return the type of the patch.
Definition: geometricSurfacePatch.H:119
Foam::geometricSurfacePatch::name
const word & name() const
Return name.
Definition: geometricSurfacePatch.H:101