surfZoneIdentifier.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-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::surfZoneIdentifier
26 
27 Description
28  An identifier for a surface zone on a meshed surface.
29 
30  Similar in concept to a faceZone on the surface, but can also have a
31  "geometricType" as well.
32 
33 SourceFiles
34  surfZoneIdentifier.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef surfZoneIdentifier_H
39 #define surfZoneIdentifier_H
40 
41 #include "word.H"
42 #include "label.H"
43 #include "typeInfo.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class dictionary;
51 
52 // Forward declaration of friend functions and operators
53 
54 class surfZoneIdentifier;
55 Ostream& operator<<(Ostream&, const surfZoneIdentifier&);
56 
57 /*---------------------------------------------------------------------------*\
58  Class surfZoneIdentifier Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 {
63  // Private Data
64 
65  //- Name of zone
66  word name_;
67 
68  //- Index of zone in surface mesh
69  label index_;
70 
71  //- Type name of zone
72  mutable word geometricType_;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct null
81 
82  //- Construct from components
84  (
85  const word& name,
86  const label index,
88 
89  );
90 
91  //- Construct from dictionary
93  (
94  const word& name,
95  const dictionary&,
96  const label index
97  );
98 
99  //- Construct from another zone identifier, resetting the index
101  (
102  const surfZoneIdentifier&,
103  const label index
104  );
105 
106 
107  //- Destructor
108  virtual ~surfZoneIdentifier();
109 
110 
111  // Member Functions
112 
113  //- Return name
114  const word& name() const
115  {
116  return name_;
117  }
118 
119  //- Return name for modification
120  word& name()
121  {
122  return name_;
123  }
124 
125  //- Return the geometric type of the zone
126  const word& geometricType() const
127  {
128  return geometricType_;
129  }
130 
131  //- Return the geometric type of the zone for modification
133  {
134  return geometricType_;
135  }
136 
137  //- Return the index of this zone in the surface mesh
138  label index() const
139  {
140  return index_;
141  }
142 
143  //- Write surfZoneIdentifier as a dictionary
144  void write(Ostream&) const;
145 
146  //- Write surfZoneIdentifier as a dictionary
147 // void writeDict(Ostream&) const;
148 
149 
150  // Member Operators
151 
152 // bool operator!=(const surfZoneIdentifier&) const;
153 //
154 // //- compare.
155 // bool operator==(const surfZoneIdentifier&) const;
156 
157  // Ostream Operator
158 
159  friend Ostream& operator<<(Ostream&, const surfZoneIdentifier&);
160 // friend Istream& operator>>(Istream&, surfZoneIdentifier&);
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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
An identifier for a surface zone on a meshed surface.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const word & name() const
Return name.
virtual ~surfZoneIdentifier()
Destructor.
friend Ostream & operator<<(Ostream &, const surfZoneIdentifier &)
Write surfZoneIdentifier as a dictionary.
const word & geometricType() const
Return the geometric type of the zone.
label index() const
Return the index of this zone in the surface mesh.
surfZoneIdentifier()
Construct null.
A class for handling words, derived from string.
Definition: word.H:59
void write(Ostream &) const
Write surfZoneIdentifier as a dictionary.
static const word null
An empty word.
Definition: word.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Ostream & operator<<(Ostream &, const ensightPart &)
Namespace for OpenFOAM.