FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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 <OpenFOAM/word.H>
42 #include <OpenFOAM/label.H>
43 #include <OpenFOAM/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 
109  virtual ~surfZoneIdentifier();
110 
111 
112  // Member Functions
113 
114  //- Return name
115  const word& name() const
116  {
117  return name_;
118  }
119 
120  //- Return name for modification
122  {
123  return name_;
124  }
125 
126  //- Return the geometric type of the zone
127  const word& geometricType() const
128  {
129  return geometricType_;
130  }
131 
132  //- Return the geometric type of the zone for modification
134  {
135  return geometricType_;
136  }
137 
138  //- Return the index of this zone in the surface mesh
139  label index() const
140  {
141  return index_;
142  }
143 
144  //- Write surfZoneIdentifier as a dictionary
145  void write(Ostream&) const;
146 
147  //- Write surfZoneIdentifier as a dictionary
148 // void writeDict(Ostream&) const;
149 
150 
151  // Member Operators
152 
153 // bool operator!=(const surfZoneIdentifier&) const;
154 //
155 // //- compare.
156 // bool operator==(const surfZoneIdentifier&) const;
157 
158  // Ostream Operator
159 
160  friend Ostream& operator<<(Ostream&, const surfZoneIdentifier&);
161 // friend Istream& operator>>(Istream&, surfZoneIdentifier&);
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************ vim: set sw=4 sts=4 et: ************************ //