Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::surfacePatch
29
30Description
31 A 'patch' on surface as subset of triSurface.
32
33SourceFiles
34 surfacePatch.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_surfacePatch_H
39#define Foam_surfacePatch_H
40
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48// Forward Declarations
49class surfZone;
51/*---------------------------------------------------------------------------*\
52 Class surfacePatch Declaration
53\*---------------------------------------------------------------------------*/
54
55class 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
68public:
69
70 // Generated Methods
71
72 //- Copy construct
73 surfacePatch(const surfacePatch&) = default;
75 //- Copy assignment
76 surfacePatch& operator=(const surfacePatch&) = default;
77
78
79 // Constructors
80
81 //- Default construct, with zero start, size, index=-1
83
84 //- Default construct, with zero start, size, and 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
123 return size_;
124 }
125
126 //- Return size of this patch in the face list
127 label& size() noexcept
128 {
129 return size_;
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
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_FOR(2020-01, "construct name/size/start/index/type")
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
177bool operator==(const surfacePatch& a, const surfacePatch& b);
178
179//- Compare patches for inequality
180bool operator!=(const surfacePatch& a, const surfacePatch& b);
181
182//- Write name, geometricType, size, start
184
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188} // End namespace Foam
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#endif
193
194// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & geometricType() const noexcept
The geometric type of the patch/zone.
label index() const noexcept
The index of this patch/zone in the surface mesh.
const word & name() const noexcept
The patch/zone name.
geometricSurfacePatch(const geometricSurfacePatch &)=default
Copy construct.
A surface zone on a MeshedSurface.
Definition surfZone.H:55
surfacePatch()
Default construct, with zero start, size, index=-1.
surfacePatch & operator=(const surfacePatch &)=default
Copy assignment.
label & size() noexcept
Return size of this patch in the face list.
label & start() noexcept
Return start label of this patch in the face list.
void writeDict(Ostream &os) const
Deprecated(2020-01) Ostream output.
label size() const noexcept
Return size of this patch in the face list.
label start() const noexcept
Return start label of this patch in the face list.
surfacePatch(const surfacePatch &)=default
Copy construct.
surfacePatch(Istream &is, const label index)=delete
Removed(2020-01) Construct from Istream.
A class for handling words, derived from Foam::string.
Definition word.H:66
static const word null
An empty word.
Definition word.H:84
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
bool operator!=(const eddy &a, const eddy &b)
Definition eddy.H:297
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
const direction noexcept
Definition scalarImpl.H:265
runTime write()
dictionary dict
volScalarField & b
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43