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 | Copyright (C) 2011-2012 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  os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
125  os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
126  os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
127 
128  forAllConstIter(dictionary, dict_, iter)
129  {
130  if
131  (
132  iter().keyword() != "type"
133  && iter().keyword() != "nFaces"
134  && iter().keyword() != "startFace"
135  )
136  {
137  iter().write(os);
138  }
139  }
140 }
141 
142 
143 // ************************************************************************* //
Foam::token::END_STATEMENT
@ END_STATEMENT
Definition: token.H:99
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polyBoundaryMesh
Foam::polyBoundaryMesh.
Definition: polyBoundaryMesh.H:60
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Foam::genericPolyPatch
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed.
Definition: genericPolyPatch.H:53
Foam::genericPolyPatch::actualTypeName_
word actualTypeName_
Definition: genericPolyPatch.H:59
Foam::genericPolyPatch::genericPolyPatch
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition: genericPolyPatch.C:43
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
Foam::label
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
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::genericPolyPatch::dict_
dictionary dict_
Definition: genericPolyPatch.H:60
Foam::Ostream::writeKeyword
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:59
Foam::UList
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::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::patchIdentifier::write
void write(Ostream &) const
Write patchIdentifier as a dictionary.
Definition: patchIdentifier.C:89
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
genericPolyPatch.H
Foam::genericPolyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: genericPolyPatch.C:121
Foam::genericPolyPatch::~genericPolyPatch
~genericPolyPatch()
Destructor.
Definition: genericPolyPatch.C:115