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
29#include "genericPolyPatch.H"
31
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)
67:
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)
79:
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)
94:
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 * * * * * * * * * * * * * * * //
117
119{}
120
121
122// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
123
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Definition: Ostream.H:239
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
virtual bool write()
Write the output fields.
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed or i...
const word & actualType() const
Return the actual type.
~genericPolyPatch()
Destructor.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
dictionary dict
volScalarField & e
Definition: createFields.H:11