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-2019 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 {
33  defineTypeNameAndDebug(genericPolyPatch, 0);
34 
35  addToRunTimeSelectionTable(polyPatch, genericPolyPatch, word);
36  addToRunTimeSelectionTable(polyPatch, genericPolyPatch, dictionary);
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 
99 (
100  const genericPolyPatch& pp,
101  const polyBoundaryMesh& bm,
102  const label index,
103  const labelUList& mapAddressing,
104  const label newStart
105 )
106 :
107  polyPatch(pp, bm, index, mapAddressing, newStart),
108  actualTypeName_(pp.actualTypeName_),
109  dict_(pp.dict_)
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
114 
116 {}
117 
118 
119 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120 
122 {
123  writeEntry(os, "type", actualTypeName_);
125  writeEntry(os, "nFaces", size());
126  writeEntry(os, "startFace", start());
127 
128  forAllConstIter(dictionary, dict_, iter)
129  {
130  if
131  (
132  iter().keyword() != "type"
133  && iter().keyword() != "nFaces"
134  && iter().keyword() != "startFace"
135  && iter().keyword() != "inGroups"
136  && iter().keyword() != "faces"
137  )
138  {
139  iter().write(os);
140  }
141  }
142 }
143 
144 
145 // ************************************************************************* //
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
#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.
~genericPolyPatch()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
void write(Ostream &) const
Write patchIdentifier as a dictionary.
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed...
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Namespace for OpenFOAM.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:864