surfZoneIdentifier.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) 2011 OpenFOAM Foundation
9  Copyright (C) 2016-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
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 
27 Class
28  Foam::surfZoneIdentifier
29 
30 Description
31  Identifies a surface patch/zone by name, patch index and geometricType.
32 
33 SeeAlso
34  patchIdentifier
35 
36 SourceFiles
37  surfZoneIdentifier.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef surfZoneIdentifier_H
42 #define surfZoneIdentifier_H
43 
44 #include "word.H"
45 #include "label.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declarations
53 class dictionary;
54 
55 /*---------------------------------------------------------------------------*\
56  Class surfZoneIdentifier Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61  // Private data
62 
63  //- Name of zone
64  word name_;
65 
66  //- Index of zone in surface mesh
67  label index_;
68 
69  //- Type name of zone
70  mutable word geometricType_;
71 
72 
73 public:
74 
75  // Public data
76 
77  //- The name for an 'empty' type
78  static const word emptyType;
79 
80 
81  // Constructors
82 
83  //- Construct null, with index zero
85 
86  //- Construct null with specified index
87  explicit surfZoneIdentifier(const label index);
88 
89  //- Construct from components
91  (
92  const word& name,
93  const label index,
95  );
96 
97  //- Construct from dictionary
99  (
100  const word& name,
101  const dictionary& dict,
102  const label index
103  );
104 
105  //- Copy construct from another zone identifier, resetting the index
107  (
108  const surfZoneIdentifier& p,
109  const label index
110  );
111 
112 
113  //- Destructor
114  virtual ~surfZoneIdentifier() = default;
115 
116 
117  // Member Functions
118 
119  //- Return name
120  const word& name() const
121  {
122  return name_;
123  }
124 
125  //- Return name for modification
126  word& name()
127  {
128  return name_;
129  }
130 
131  //- Return the geometric type of the patch/zone
132  const word& geometricType() const
133  {
134  return geometricType_;
135  }
136 
137  //- Return the geometric type of the patch/zone for modification
139  {
140  return geometricType_;
141  }
142 
143  //- Return the index of this patch/zone in the surface mesh
144  label index() const
145  {
146  return index_;
147  }
148 
149  //- Return the index of this patch/zone for modification
150  label& index()
151  {
152  return index_;
153  }
154 
155 
156  //- Write identifier as a dictionary
157  void write(Ostream& os) const;
158 };
159 
160 
161 // Global Operators
162 
163 // Ostream Operator
164 
165 //- Read name/type
166 Istream& operator>>(Istream& is, surfZoneIdentifier& obj);
167 
168 //- Write name/type
169 Ostream& operator<<(Ostream& os, const surfZoneIdentifier& obj);
170 
171 //- Compare zone indentifiers for equality
172 bool operator==(const surfZoneIdentifier& a, const surfZoneIdentifier& b);
173 
174 //- Compare zone indentifiers for inequality
175 bool operator!=(const surfZoneIdentifier& a, const surfZoneIdentifier& b);
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
Foam::surfZoneIdentifier::write
void write(Ostream &os) const
Write identifier as a dictionary.
Definition: surfZoneIdentifier.C:97
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::surfZoneIdentifier::name
word & name()
Return name for modification.
Definition: surfZoneIdentifier.H:125
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:228
Foam::surfZoneIdentifier::index
label index() const
Return the index of this patch/zone in the surface mesh.
Definition: surfZoneIdentifier.H:143
Foam::surfZoneIdentifier
Identifies a surface patch/zone by name, patch index and geometricType.
Definition: surfZoneIdentifier.H:58
Foam::surfZoneIdentifier::geometricType
word & geometricType()
Return the geometric type of the patch/zone for modification.
Definition: surfZoneIdentifier.H:137
Foam::operator!=
bool operator!=(const eddy &a, const eddy &b)
Definition: eddy.H:235
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:62
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::surfZoneIdentifier::index
label & index()
Return the index of this patch/zone for modification.
Definition: surfZoneIdentifier.H:149
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::surfZoneIdentifier::surfZoneIdentifier
surfZoneIdentifier()
Construct null, with index zero.
Definition: surfZoneIdentifier.C:39
Foam::surfZoneIdentifier::geometricType
const word & geometricType() const
Return the geometric type of the patch/zone.
Definition: surfZoneIdentifier.H:131
label.H
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::surfZoneIdentifier::name
const word & name() const
Return name.
Definition: surfZoneIdentifier.H:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
word.H
Foam::surfZoneIdentifier::~surfZoneIdentifier
virtual ~surfZoneIdentifier()=default
Destructor.
Foam::surfZoneIdentifier::emptyType
static const word emptyType
The name for an 'empty' type.
Definition: surfZoneIdentifier.H:77
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102