Loading...
Searching...
No Matches
genericPolyPatch.C
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
27\*---------------------------------------------------------------------------*/
28
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
37
40}
41
42
43// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
44
46(
47 const word& name,
48 const label size,
49 const label start,
50 const label index,
51 const polyBoundaryMesh& bm,
52 const word& patchType
53)
54:
55 polyPatch(name, size, start, index, bm, patchType)
56{}
57
58
60(
61 const word& name,
62 const dictionary& dict,
63 const label index,
64 const polyBoundaryMesh& bm,
65 const word& patchType
66)
68 polyPatch(name, dict, index, bm, patchType),
69 actualTypeName_(dict.get<word>("type")),
70 dict_(dict)
71{}
72
73
75(
76 const genericPolyPatch& pp,
77 const polyBoundaryMesh& bm
78)
80 polyPatch(pp, bm),
81 actualTypeName_(pp.actualTypeName_),
82 dict_(pp.dict_)
83{}
84
85
87(
88 const genericPolyPatch& pp,
89 const polyBoundaryMesh& bm,
90 const label index,
91 const label newSize,
92 const label newStart
93)
95 polyPatch(pp, bm, index, newSize, newStart),
96 actualTypeName_(pp.actualTypeName_),
97 dict_(pp.dict_)
98{}
99
100
102(
103 const genericPolyPatch& pp,
104 const polyBoundaryMesh& bm,
105 const label index,
106 const labelUList& mapAddressing,
107 const label newStart
108)
109:
110 polyPatch(pp, bm, index, mapAddressing, newStart),
111 actualTypeName_(pp.actualTypeName_),
112 dict_(pp.dict_)
113{}
114
115
116// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
121
122// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
125{
126 return actualTypeName_;
127}
128
129
131{
132 os.writeEntry("type", actualTypeName_);
134 os.writeEntry("nFaces", size());
135 os.writeEntry("startFace", start());
136
137 for (const entry& e : dict_)
138 {
139 const word& key = e.keyword();
140
141 // Filter out any keywords already written by above
142 if
143 (
144 key != "type"
145 && key != "nFaces"
146 && key != "startFace"
147 && key != "physicalType"
148 && key != "inGroups"
149 )
150 {
151 e.write(os);
152 }
153 }
154}
155
156
157// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
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
bool get(const label i) const
Definition UList.H:868
void size(const label n)
Definition UList.H:118
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A keyword and a list of tokens is an 'entry'.
Definition entry.H:66
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed or i...
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
const word & actualType() const
Return the actual type.
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
void write(Ostream &os) const
Write (physicalType, inGroups) dictionary entries (without surrounding braces).
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,...
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
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
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
OBJstream os(runTime.globalPath()/outputName)
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
dictionary dict
volScalarField & e