OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

surfZoneIdentifier.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "surfZoneIdentifier.H"
00028 #include "dictionary.H"
00029 
00030 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00031 
00032 Foam::surfZoneIdentifier::surfZoneIdentifier()
00033 :
00034     name_(word::null),
00035     index_(0),
00036     geometricType_(word::null)
00037 {}
00038 
00039 
00040 Foam::surfZoneIdentifier::surfZoneIdentifier
00041 (
00042     const word& name,
00043     const label index,
00044     const word& geometricType
00045 )
00046 :
00047     name_(name),
00048     index_(index),
00049     geometricType_(geometricType)
00050 {}
00051 
00052 
00053 Foam::surfZoneIdentifier::surfZoneIdentifier
00054 (
00055     const word& name,
00056     const dictionary& dict,
00057     const label index
00058 )
00059 :
00060     name_(name),
00061     index_(index)
00062 {
00063     dict.readIfPresent("geometricType", geometricType_);
00064 }
00065 
00066 
00067 Foam::surfZoneIdentifier::surfZoneIdentifier
00068 (
00069     const surfZoneIdentifier& p,
00070     const label index
00071 )
00072 :
00073     name_(p.name()),
00074     index_(index),
00075     geometricType_(p.geometricType())
00076 {}
00077 
00078 
00079 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00080 
00081 Foam::surfZoneIdentifier::~surfZoneIdentifier()
00082 {}
00083 
00084 
00085 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00086 
00087 
00088 void Foam::surfZoneIdentifier::write(Ostream& os) const
00089 {
00090     if (geometricType_.size())
00091     {
00092         os.writeKeyword("geometricType") << geometricType_
00093             << token::END_STATEMENT << nl;
00094     }
00095 }
00096 
00097 
00098 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00099 
00100 // bool Foam::surfZoneIdentifier::operator!=
00101 // (
00102 //     const surfZoneIdentifier& p
00103 // ) const
00104 // {
00105 //     return !(*this == p);
00106 // }
00107 //
00108 //
00109 // bool Foam::surfZoneIdentifier::operator==
00110 // (
00111 //     const surfZoneIdentifier& p
00112 // ) const
00113 // {
00114 //     return geometricType() == p.geometricType() && name() == p.name();
00115 // }
00116 
00117 
00118 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
00119 
00120 // Foam::Istream& Foam::operator>>(Istream& is, surfZoneIdentifier& p)
00121 // {
00122 //     is >> p.name_ >> p.geometricType_;
00123 //
00124 //     return is;
00125 // }
00126 
00127 
00128 Foam::Ostream& Foam::operator<<(Ostream& os, const surfZoneIdentifier& p)
00129 {
00130     p.write(os);
00131     os.check
00132     (
00133         "Ostream& operator<<(Ostream&, const surfZoneIdentifier&)"
00134     );
00135     return os;
00136 }
00137 
00138 
00139 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd