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 \*---------------------------------------------------------------------------*/
27 #include "dictionary.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 defineTypeNameAndDebug(Foam::surfZone, 0);
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 Foam::surfZone::surfZone()
45 Foam::surfZone::surfZone
51 const word& geometricType
54 surfZoneIdentifier(name, index, geometricType),
60 Foam::surfZone::surfZone(Istream& is, const label index)
69 operator=(surfZone(name, dict, index));
73 Foam::surfZone::surfZone
76 const dictionary& dict,
80 surfZoneIdentifier(name, dict, index),
81 size_(readLabel(dict.lookup("nFaces"))),
82 start_(readLabel(dict.lookup("startFace")))
86 Foam::surfZone::surfZone(const surfZone& zone)
88 surfZoneIdentifier(zone, zone.index()),
94 Foam::surfZone::surfZone(const surfZone& zone, const label index)
96 surfZoneIdentifier(zone, index),
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104 void Foam::surfZone::write(Ostream& os) const
110 void Foam::surfZone::writeDict(Ostream& os) const
112 os << indent << name() << nl
113 << indent << token::BEGIN_BLOCK << incrIndent << nl;
115 surfZoneIdentifier::write(os);
116 os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
117 os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
119 os << decrIndent << indent << token::END_BLOCK << endl;
123 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
125 bool Foam::surfZone::operator!=(const surfZone& rhs) const
127 return !(*this == rhs);
131 bool Foam::surfZone::operator==(const surfZone& rhs) const
136 && start() == rhs.start()
137 && geometricType() == rhs.geometricType()
142 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
144 Foam::Istream& Foam::operator>>(Istream& is, surfZone& zone)
146 zone = surfZone(is, 0);
148 is.check("Istream& operator>>(Istream&, surfZone&)");
153 Foam::Ostream& Foam::operator<<(Ostream& os, const surfZone& zone)
156 os.check("Ostream& operator<<(Ostream&, const surfZone&");
161 // ************************************************************************* //