surfacePatch.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::surfacePatch
26 
27 Description
28  'Patch' on surface as subset of triSurface.
29 
30 SourceFiles
31  surfacePatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef surfacePatch_H
36 #define surfacePatch_H
37 
38 #include "geometricSurfacePatch.H"
39 #include "word.H"
40 #include "label.H"
41 #include "className.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 
50 class surfacePatch;
51 
52 Ostream& operator<<(Ostream&, const surfacePatch&);
53 
54 
55 /*---------------------------------------------------------------------------*\
56  Class surfacePatch Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class surfacePatch
60 :
62 {
63  // Private data
64 
65  //- Size of this patch in the triSurface face list
66  label size_;
67 
68  //- Start label of this patch in the triSurface face list
69  label start_;
70 
71 public:
72 
73  //- Runtime type information
74  ClassName("surfacePatch");
75 
76 
77  // Constructors
78 
79  //- Construct null
80  surfacePatch();
81 
82  //- Construct from components
84  (
85  const word& geometricType,
86  const word& name,
87  const label size,
88  const label start,
89  const label index
90  );
91 
92  //- Construct from Istream
93  surfacePatch(Istream& is, const label index);
94 
95  //- Construct from dictionary
97  (
98  const word& name,
99  const dictionary& dict,
100  const label index
101  );
102 
103  //- Construct as copy
104  surfacePatch(const surfacePatch&);
105 
106 
107  // Member Functions
108 
109  //- Return start label of this patch in the polyMesh face list
110  label start() const
111  {
112  return start_;
113  }
114 
115  //- Return start label of this patch in the polyMesh face list
116  label& start()
117  {
118  return start_;
119  }
120 
121  //- Return size of this patch in the polyMesh face list
122  label size() const
123  {
124  return size_;
125  }
126 
127  //- Return size of this patch in the polyMesh face list
128  label& size()
129  {
130  return size_;
131  }
132 
133  //- Write
134  void write(Ostream&) const;
135 
136  //- Write dictionary
137  void writeDict(Ostream&) const;
138 
139 
140  // Member Operators
141 
142  bool operator!=(const surfacePatch&) const;
143 
144  //- compare.
145  bool operator==(const surfacePatch&) const;
146 
147  // IOstream Operators
148 
149  friend Ostream& operator<<(Ostream&, const surfacePatch&);
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
dictionary dict
bool operator==(const surfacePatch &) const
compare.
Definition: surfacePatch.C:123
label start() const
Return start label of this patch in the polyMesh face list.
Definition: surfacePatch.H:109
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
ClassName("surfacePatch")
Runtime type information.
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.
friend Ostream & operator<<(Ostream &, const surfacePatch &)
&#39;Patch&#39; on surface as subset of triSurface.
Definition: surfacePatch.H:58
A class for handling words, derived from string.
Definition: word.H:59
void writeDict(Ostream &) const
Write dictionary.
Definition: surfacePatch.C:103
surfacePatch()
Construct null.
Definition: surfacePatch.C:39
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void write(Ostream &) const
Write.
Definition: surfacePatch.C:96
label size() const
Return size of this patch in the polyMesh face list.
Definition: surfacePatch.H:121
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Ostream & operator<<(Ostream &, const ensightPart &)
bool operator!=(const surfacePatch &) const
Definition: surfacePatch.C:117
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.
Namespace for OpenFOAM.