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-2019 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 
72 public:
73 
74  //- Runtime type information
75  ClassName("surfacePatch");
76 
77 
78  // Constructors
79 
80  //- Construct null
81  surfacePatch();
82 
83  //- Construct from components
85  (
86  const word& geometricType,
87  const word& name,
88  const label size,
89  const label start,
90  const label index
91  );
92 
93  //- Construct from Istream
94  surfacePatch(Istream& is, const label index);
95 
96  //- Construct from dictionary
98  (
99  const word& name,
100  const dictionary& dict,
101  const label index
102  );
103 
104 
105  // Member Functions
106 
107  //- Return start label of this patch in the polyMesh face list
108  label start() const
109  {
110  return start_;
111  }
112 
113  //- Return start label of this patch in the polyMesh face list
114  label& start()
115  {
116  return start_;
117  }
118 
119  //- Return size of this patch in the polyMesh face list
120  label size() const
121  {
122  return size_;
123  }
124 
125  //- Return size of this patch in the polyMesh face list
126  label& size()
127  {
128  return size_;
129  }
130 
131  //- Write
132  void write(Ostream&) const;
133 
134  //- Write dictionary
135  void writeDict(Ostream&) const;
136 
137 
138  // Member Operators
139 
140  bool operator!=(const surfacePatch&) const;
141 
142  //- compare.
143  bool operator==(const surfacePatch&) const;
144 
145  // IOstream Operators
146 
147  friend Ostream& operator<<(Ostream&, const surfacePatch&);
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
dictionary dict
bool operator==(const surfacePatch &) const
compare.
Definition: surfacePatch.C:115
label start() const
Return start label of this patch in the polyMesh face list.
Definition: surfacePatch.H:107
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:158
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:95
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:54
void write(Ostream &) const
Write.
Definition: surfacePatch.C:88
label size() const
Return size of this patch in the polyMesh face list.
Definition: surfacePatch.H:119
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Ostream & operator<<(Ostream &, const ensightPart &)
bool operator!=(const surfacePatch &) const
Definition: surfacePatch.C:109
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.