geometricSurfacePatch.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) 2011-2018 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::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
59  word geometricType_;
60 
61  //- Name of patch
62  word name_;
63 
64  //- Index of patch in boundary
65  label index_;
66 
67 public:
68 
69  //- Runtime type information
70  ClassName("geometricSurfacePatch");
71 
72 
73  // Constructors
74 
75  //- Construct null
77 
78  //- Construct from components
80  (
81  const word& geometricType,
82  const word& name,
83  const label index
84  );
85 
86  //- Construct from Istream
87  geometricSurfacePatch(Istream&, const label index);
88 
89  //- Construct from dictionary
91  (
92  const word& name,
93  const dictionary& dict,
94  const label index
95  );
96 
97 
98  // Member Functions
99 
100  //- Return name
101  const word& name() const
102  {
103  return name_;
104  }
105 
106  //- Return name
107  word& name()
108  {
109  return name_;
110  }
111 
112  //- Return the type of the patch
113  const word& geometricType() const
114  {
115  return geometricType_;
116  }
117 
118  //- Return the type of the patch
120  {
121  return geometricType_;
122  }
123 
124  //- Return the index of this patch in the boundaryMesh
125  label index() const
126  {
127  return index_;
128  }
129 
130  //- Return the index of this patch in the boundaryMesh
131  label& index()
132  {
133  return index_;
134  }
135 
136  //- Write
137  void write(Ostream&) const;
138 
139  //- Write dictionary
140  void writeDict(Ostream&) const;
141 
142 
143  // Member Operators
144 
145  bool operator!=(const geometricSurfacePatch&) const;
146 
147  //- compare.
148  bool operator==(const geometricSurfacePatch&) const;
149 
150 
151  // Ostream Operator
152 
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
friend Istream & operator>>(Istream &, geometricSurfacePatch &)
dictionary dict
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
const word & name() const
Return name.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const word & geometricType() const
Return the type of the patch.
geometricSurfacePatch()
Construct null.
friend Ostream & operator<<(Ostream &, const geometricSurfacePatch &)
A class for handling words, derived from string.
Definition: word.H:59
void write(Ostream &) const
Write.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index...
label index() const
Return the index of this patch in the boundaryMesh.
bool operator==(const geometricSurfacePatch &) const
compare.
ClassName("geometricSurfacePatch")
Runtime type information.
bool operator!=(const geometricSurfacePatch &) const
void writeDict(Ostream &) const
Write dictionary.
Namespace for OpenFOAM.