Report patch name instead of index in debug
[foam-extend-3.2.git] / src / foam / meshes / polyMesh / polyPatches / basic / generic / genericPolyPatch.C
bloba1baba28644c6a8cd2615b16e848623b94834395
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "genericPolyPatch.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
33     defineTypeNameAndDebug(genericPolyPatch, 0);
35     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, word);
36     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, dictionary);
40 // * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * * * * //
42 Foam::genericPolyPatch::genericPolyPatch
44     const word& name,
45     const label size,
46     const label start,
47     const label index,
48     const polyBoundaryMesh& bm
51     polyPatch(name, size, start, index, bm)
55 Foam::genericPolyPatch::genericPolyPatch
57     const word& name,
58     const dictionary& dict,
59     const label index,
60     const polyBoundaryMesh& bm
63     polyPatch(name, dict, index, bm),
64     actualTypeName_(dict.lookup("type")),
65     dict_(dict)
69 Foam::genericPolyPatch::genericPolyPatch
71     const genericPolyPatch& pp,
72     const polyBoundaryMesh& bm
75     polyPatch(pp, bm),
76     actualTypeName_(pp.actualTypeName_),
77     dict_(pp.dict_)
81 Foam::genericPolyPatch::genericPolyPatch
83     const genericPolyPatch& pp,
84     const polyBoundaryMesh& bm,
85     const label index,
86     const label newSize,
87     const label newStart
90     polyPatch(pp, bm, index, newSize, newStart),
91     actualTypeName_(pp.actualTypeName_),
92     dict_(pp.dict_)
96 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
98 Foam::genericPolyPatch::~genericPolyPatch()
102 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
104 void Foam::genericPolyPatch::write(Ostream& os) const
106     os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
107     patchIdentifier::write(os);
108     os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
109     os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
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     }
131 // ************************************************************************* //