Loading...
Searching...
No Matches
genericPolyPatch.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-2012 OpenFOAM Foundation
9 Copyright (C) 2016 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::genericPolyPatch
29
30Description
31 Substitute for unknown patches.
32 Used for postprocessing when only basic polyPatch info is needed
33 or if the real patch type is unavailable.
34
35Note
36 Storage is not optimal. It stores all face centres and cells on all
37 processors to keep the addressing calculation simple.
38
39SourceFiles
40 genericPolyPatch.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef genericPolyPatch_H
45#define genericPolyPatch_H
46
47#include "polyPatch.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
54/*---------------------------------------------------------------------------*\
55 Class genericPolyPatch Declaration
56\*---------------------------------------------------------------------------*/
57
59:
60 public polyPatch
61{
62 // Private data
63
64 const word actualTypeName_;
65 dictionary dict_;
66
67public:
68
69 //- Runtime type information
70 TypeName("genericPatch");
71
72
73 // Constructors
74
75 //- Construct from components
77 (
78 const word& name,
79 const label size,
80 const label start,
81 const label index,
82 const polyBoundaryMesh& bm,
83 const word& patchType
84 );
85
86 //- Construct from dictionary
88 (
89 const word& name,
90 const dictionary& dict,
91 const label index,
92 const polyBoundaryMesh& bm,
93 const word& patchType
94 );
95
96 //- Construct as copy, resetting the boundary mesh
98 (
99 const genericPolyPatch&,
100 const polyBoundaryMesh&
101 );
102
103 //- Construct given the original patch and resetting the
104 // face list and boundary mesh information
106 (
107 const genericPolyPatch& pp,
108 const polyBoundaryMesh& bm,
109 const label index,
110 const label newSize,
111 const label newStart
112 );
113
114 //- Construct given the original patch and a map
116 (
117 const genericPolyPatch& pp,
118 const polyBoundaryMesh& bm,
119 const label index,
120 const labelUList& mapAddressing,
121 const label newStart
122 );
123
124 //- Construct and return a clone, resetting the boundary mesh
125 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
126 {
127 return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
128 }
129
130 //- Construct and return a clone, resetting the face list
131 // and boundary mesh
133 (
134 const polyBoundaryMesh& bm,
135 const label index,
136 const label newSize,
137 const label newStart
138 ) const
139 {
140 return autoPtr<polyPatch>
141 (
142 new genericPolyPatch(*this, bm, index, newSize, newStart)
143 );
144 }
146 //- Construct and return a clone, resetting the face list
147 // and boundary mesh
149 (
150 const polyBoundaryMesh& bm,
151 const label index,
152 const labelUList& mapAddressing,
153 const label newStart
154 ) const
155 {
156 return autoPtr<polyPatch>
157 (
158 new genericPolyPatch(*this, bm, index, mapAddressing, newStart)
159 );
160 }
161
162
163 //- Destructor
165
166
167 // Member functions
168
169 //- Return the actual type
170 const word& actualType() const;
171
172 //- Write the polyPatch data as a dictionary
173 virtual void write(Ostream&) const;
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183#endif
184
185// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
void size(const label n)
Definition UList.H:118
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
TypeName("genericPatch")
Runtime type information.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart) const
Construct and return a clone, resetting the face list.
const word & actualType() const
Return the actual type.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart) const
Construct and return a clone, resetting the face list.
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
label index() const noexcept
The index of this patch in the boundaryMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
friend class polyBoundaryMesh
Definition polyPatch.H:112
polyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition polyPatch.C:75
label start() const noexcept
Return start label of this patch in the polyMesh face list.
Definition polyPatch.H:446
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
UList< label > labelUList
A UList of labels.
Definition UList.H:75
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68