genericPolyPatch.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "genericPolyPatch.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
34 
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
43 (
44  const word& name,
45  const label size,
46  const label start,
47  const label index,
48  const polyBoundaryMesh& bm
49 )
50 :
51  polyPatch(name, size, start, index, bm)
52 {}
53 
54 
56 (
57  const word& name,
58  const dictionary& dict,
59  const label index,
60  const polyBoundaryMesh& bm
61 )
62 :
63  polyPatch(name, dict, index, bm),
64  actualTypeName_(dict.lookup("type")),
65  dict_(dict)
66 {}
67 
68 
70 (
71  const genericPolyPatch& pp,
72  const polyBoundaryMesh& bm
73 )
74 :
75  polyPatch(pp, bm),
76  actualTypeName_(pp.actualTypeName_),
77  dict_(pp.dict_)
78 {}
79 
80 
82 (
83  const genericPolyPatch& pp,
84  const polyBoundaryMesh& bm,
85  const label index,
86  const label newSize,
87  const label newStart
88 )
89 :
90  polyPatch(pp, bm, index, newSize, newStart),
91  actualTypeName_(pp.actualTypeName_),
92  dict_(pp.dict_)
93 {}
94 
95 
96 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 
105 {
106  writeEntry(os, "type", actualTypeName_);
108  writeEntry(os, "nFaces", size());
109  writeEntry(os, "startFace", start());
110 
111  forAllConstIter(dictionary, dict_, iter)
112  {
113  if
114  (
115  iter().keyword() != "type"
116  && iter().keyword() != "nFaces"
117  && iter().keyword() != "startFace"
118  && iter().keyword() != "inGroups"
119  && iter().keyword() != "faces"
120  )
121  {
122  iter().write(os);
123  }
124  }
125 }
126 
127 
128 // ************************************************************************* //
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:492
Macros for easy insertion into run-time selection tables.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Substitute for unknown patches. Used for post-processing when only basic polyPatch info is needed.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Construct from components.
~genericPolyPatch()
Destructor.
void write(Ostream &) const
Write patchIdentifier as a dictionary.
Foam::polyBoundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
A class for handling words, derived from string.
Definition: word.H:63
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict