FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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 )
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  os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
108  os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
109  os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
110 
111  for
112  (
113  dictionary::const_iterator iter = dict_.begin();
114  iter != dict_.end();
115  ++iter
116  )
117  {
118  if
119  (
120  iter().keyword() != "type"
121  && iter().keyword() != "nFaces"
122  && iter().keyword() != "startFace"
123  )
124  {
125  iter().write(os);
126  }
127  }
128 }
129 
130 
131 // ************************ vim: set sw=4 sts=4 et: ************************ //