surfacePatch.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::surfacePatch
29 
30 Description
31  A 'patch' on surface as subset of triSurface.
32 
33 SourceFiles
34  surfacePatch.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef surfacePatch_H
39 #define surfacePatch_H
40 
41 #include "geometricSurfacePatch.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 class surfZone;
50 
51 /*---------------------------------------------------------------------------*\
52  Class surfacePatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class surfacePatch
56 :
58 {
59  // Private Data
60 
61  //- Size of this patch in the face list
62  label size_;
63 
64  //- Start label of this patch in the face list
65  label start_;
66 
67 
68 public:
69 
70  // Generated Methods
71 
72  //- Copy construct
73  surfacePatch(const surfacePatch&) = default;
74 
75  //- Copy assignment
76  surfacePatch& operator=(const surfacePatch&) = default;
77 
78 
79  // Constructors
80 
81  //- Default construct, with zero start, size, index=-1
82  surfacePatch();
83 
84  //- Construct null with specified index
85  explicit surfacePatch(const label index);
86 
87  //- Construct from components
89  (
90  const word& name,
91  const label size,
92  const label start,
93  const label index,
95  );
96 
97  //- Construct from dictionary
99  (
100  const word& name,
101  const dictionary& dict,
102  const label index
103  );
104 
105 
106  // Member Functions
107 
108  //- Return start label of this patch in the face list
109  label start() const noexcept
110  {
111  return start_;
112  }
113 
114  //- Return start label of this patch in the face list
115  label& start() noexcept
116  {
117  return start_;
118  }
119 
120  //- Return size of this patch in the face list
121  label size() const noexcept
122  {
123  return size_;
124  }
125 
126  //- Return size of this patch in the face list
127  label& size() noexcept
128  {
129  return size_;
130  }
131 
132  //- Write dictionary, includes surrounding braces
133  // \warning Prior to 2020-01 was identical to operator<< output
134  void write(Ostream& os) const;
135 
136 
137  // Member Operators
138 
139  //- Conversion to surfZone representation
140  explicit operator surfZone() const;
141 
142 
143  // Housekeeping
144 
145  //- Removed(2020-01) Construct from Istream
146  // \deprecated(2020-01) - unused, inconsistent
147  surfacePatch(Istream& is, const label index) = delete;
148 
149  //- Deprecated(2020-01) Construct from components
150  // \deprecated(2020-01) - order inconsistent with other identifiers
151  FOAM_DEPRECATED(2020-01)
153  (
154  const word& geometricType,
155  const word& name,
156  const label size,
157  const label start,
158  const label index
159  )
160  :
162  {}
163 
164  //- Deprecated(2020-01) Ostream output
165  // \deprecated(2020-01) - Ostream output
166  FOAM_DEPRECATED_FOR(2020-01, "write() or operator<<")
167  void writeDict(Ostream& os) const
168  {
169  write(os);
170  }
171 };
172 
173 
174 // Global Operators
175 
176 //- Compare patches for equality
177 bool operator==(const surfacePatch& a, const surfacePatch& b);
178 
179 //- Compare patches for inequality
180 bool operator!=(const surfacePatch& a, const surfacePatch& b);
181 
182 //- Write name, geometricType, size, start
183 Ostream& operator<<(Ostream& os, const surfacePatch& obj);
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::surfacePatch::operator=
surfacePatch & operator=(const surfacePatch &)=default
Copy assignment.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::surfacePatch::start
label & start() noexcept
Return start label of this patch in the face list.
Definition: surfacePatch.H:114
Foam::geometricSurfacePatch
Identifies a surface patch/zone by name and index, with geometric type.
Definition: geometricSurfacePatch.H:53
geometricSurfacePatch.H
Foam::operator!=
bool operator!=(const eddy &a, const eddy &b)
Definition: eddy.H:239
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::surfacePatch::size
label size() const noexcept
Return size of this patch in the face list.
Definition: surfacePatch.H:120
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::geometricSurfacePatch::index
label index() const noexcept
The index of this patch/zone in the surface mesh.
Definition: geometricSurfacePatch.H:161
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::surfacePatch::size
label & size() noexcept
Return size of this patch in the face list.
Definition: surfacePatch.H:126
Foam::surfacePatch
A 'patch' on surface as subset of triSurface.
Definition: surfacePatch.H:54
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
FOAM_DEPRECATED
#define FOAM_DEPRECATED(since)
Definition: stdFoam.H:65
Foam::surfZone
A surface zone on a MeshedSurface.
Definition: surfZone.H:56
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::FOAM_DEPRECATED_FOR
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:69
Foam::geometricSurfacePatch::geometricType
const word & geometricType() const noexcept
The geometric type of the patch/zone.
Definition: geometricSurfacePatch.H:173
Foam::geometricSurfacePatch::name
const word & name() const noexcept
The patch/zone name.
Definition: geometricSurfacePatch.H:149
Foam::surfacePatch::write
void write(Ostream &os) const
Write dictionary, includes surrounding braces.
Definition: surfacePatch.C:79
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::surfacePatch::surfacePatch
surfacePatch()
Default construct, with zero start, size, index=-1.
Definition: surfacePatch.C:35
Foam::surfacePatch::start
label start() const noexcept
Return start label of this patch in the face list.
Definition: surfacePatch.H:108
Foam::surfacePatch::writeDict
void writeDict(Ostream &os) const
Deprecated(2020-01) Ostream output.
Definition: surfacePatch.H:166