surfacePatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation, either version 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. 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 /*---------------------------------------------------------------------------*\
49  Class surfacePatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class surfacePatch
53 :
55 {
56  // Private data
57 
58  //- size of this patch in the triSurface face list
59  label size_;
60 
61  //- Start label of this patch in the triSurface face list
62  label start_;
63 
64 public:
65 
66  //- Runtime type information
67  ClassName("surfacePatch");
68 
69 
70  // Constructors
71 
72  //- Construct null
73  surfacePatch();
74 
75  //- Construct from components
77  (
78  const word& geometricType,
79  const word& name,
80  const label size,
81  const label start,
82  const label index
83  );
84 
85  //- Construct from Istream
86  surfacePatch(Istream& is, const label index);
87 
88  //- Construct from dictionary
90  (
91  const word& name,
92  const dictionary& dict,
93  const label index
94  );
95 
96  //- Construct as copy
97  surfacePatch(const surfacePatch&);
98 
99 
100  // Member Functions
101 
102  //- Return start label of this patch in the polyMesh face list
103  label start() const
104  {
105  return start_;
106  }
107 
108  //- Return start label of this patch in the polyMesh face list
109  label& start()
110  {
111  return start_;
112  }
113 
114  //- Return size of this patch in the polyMesh face list
115  label size() const
116  {
117  return size_;
118  }
119 
120  //- Return size of this patch in the polyMesh face list
121  label& size()
122  {
123  return size_;
124  }
125 
126  //- Write
127  void write(Ostream&) const;
128 
129  //- Write dictionary
130  void writeDict(Ostream&) const;
131 
132 
133  // Member Operators
134 
135  bool operator!=(const surfacePatch&) const;
136 
137  //- compare.
138  bool operator==(const surfacePatch&) const;
139 
140  // IOstream Operators
141 
142  friend Ostream& operator<<(Ostream&, const surfacePatch&);
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::geometricSurfacePatch::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: geometricSurfacePatch.H:125
Foam::surfacePatch::size
label & size()
Return size of this patch in the polyMesh face list.
Definition: surfacePatch.H:120
Foam::surfacePatch::size
label size() const
Return size of this patch in the polyMesh face list.
Definition: surfacePatch.H:114
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::geometricSurfacePatch
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index.
Definition: geometricSurfacePatch.H:53
Foam::surfacePatch::ClassName
ClassName("surfacePatch")
Runtime type information.
Foam::surfacePatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: surfacePatch.H:102
Foam::surfacePatch::size_
label size_
size of this patch in the triSurface face list
Definition: surfacePatch.H:58
Foam::surfacePatch::writeDict
void writeDict(Ostream &) const
Write dictionary.
Definition: surfacePatch.C:109
Foam::surfacePatch::write
void write(Ostream &) const
Write.
Definition: surfacePatch.C:102
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:59
Foam::geometricSurfacePatch::geometricType
const word & geometricType() const
Return the type of the patch.
Definition: geometricSurfacePatch.H:113
Foam::surfacePatch::operator<<
friend Ostream & operator<<(Ostream &, const surfacePatch &)
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::surfacePatch::start
label & start()
Return start label of this patch in the polyMesh face list.
Definition: surfacePatch.H:108
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::surfacePatch
'Patch' on surface as subset of triSurface.
Definition: surfacePatch.H:51
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::surfacePatch::operator!=
bool operator!=(const surfacePatch &) const
Definition: surfacePatch.C:123
label.H
Foam::surfacePatch::start_
label start_
Start label of this patch in the triSurface face list.
Definition: surfacePatch.H:61
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
word.H
Foam::surfacePatch::surfacePatch
surfacePatch()
Construct null.
Definition: surfacePatch.C:41
Foam::geometricSurfacePatch::name
const word & name() const
Return name.
Definition: geometricSurfacePatch.H:101
Foam::surfacePatch::operator==
bool operator==(const surfacePatch &) const
compare.
Definition: surfacePatch.C:129