1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "boundaryPatch.H"
27 #include "dictionary.H"
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 Foam::boundaryPatch::boundaryPatch
38 const word& physicalType
41 patchIdentifier(name, index, physicalType),
47 Foam::boundaryPatch::boundaryPatch
50 const dictionary& dict,
54 patchIdentifier(name, dict, index),
55 size_(readLabel(dict.lookup("nFaces"))),
56 start_(readLabel(dict.lookup("startFace")))
60 Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p)
62 patchIdentifier(p.name(), p.index(), p.physicalType()),
68 Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p, const label index)
70 patchIdentifier(p.name(), index, p.physicalType()),
76 Foam::autoPtr<Foam::boundaryPatch> Foam::boundaryPatch::clone() const
78 return autoPtr<boundaryPatch>(new boundaryPatch(*this));
82 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
84 Foam::boundaryPatch::~boundaryPatch()
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 void Foam::boundaryPatch::write(Ostream& os) const
92 patchIdentifier::write(os);
93 os.writeKeyword("nFaces") << size_ << token::END_STATEMENT << nl;
94 os.writeKeyword("startFace") << start_ << token::END_STATEMENT << nl;
98 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
100 Foam::Ostream& Foam::operator<<(Ostream& os, const boundaryPatch& p)
103 os.check("Ostream& operator<<(Ostream& f, const boundaryPatch&)");
108 // ************************************************************************* //