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-2023 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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  const word& patchType
50 )
51 :
52  polyPatch(name, size, start, index, bm, patchType)
53 {}
54 
55 
57 (
58  const word& name,
59  const dictionary& dict,
60  const label index,
61  const polyBoundaryMesh& bm,
62  const word& patchType
63 )
64 :
65  polyPatch(name, dict, index, bm, patchType),
66  actualTypeName_(dict.lookup("type")),
67  dict_(dict)
68 {}
69 
70 
72 (
73  const genericPolyPatch& pp,
74  const polyBoundaryMesh& bm
75 )
76 :
77  polyPatch(pp, bm),
78  actualTypeName_(pp.actualTypeName_),
79  dict_(pp.dict_)
80 {}
81 
82 
84 (
85  const genericPolyPatch& pp,
86  const polyBoundaryMesh& bm,
87  const label index,
88  const label newSize,
89  const label newStart
90 )
91 :
92  polyPatch(pp, bm, index, newSize, newStart),
93  actualTypeName_(pp.actualTypeName_),
94  dict_(pp.dict_)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99 
101 {}
102 
103 
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105 
107 {
108  writeEntry(os, "type", actualTypeName_);
110  writeEntry(os, "nFaces", size());
111  writeEntry(os, "startFace", start());
112 
113  forAllConstIter(dictionary, dict_, iter)
114  {
115  if
116  (
117  iter().keyword() != "type"
118  && iter().keyword() != "nFaces"
119  && iter().keyword() != "startFace"
120  && iter().keyword() != "inGroups"
121  && iter().keyword() != "faces"
122  )
123  {
124  iter().write(os);
125  }
126  }
127 }
128 
129 
130 // ************************************************************************* //
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:477
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
~genericPolyPatch()
Destructor.
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 &) 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:70
A class for handling words, derived from string.
Definition: word.H:62
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
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
dictionary dict