FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "surfZoneIdentifier.H"
00027 #include <OpenFOAM/dictionary.H>
00028 
00029 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00030 
00031 Foam::surfZoneIdentifier::surfZoneIdentifier()
00032 :
00033     name_(word::null),
00034     index_(0),
00035     geometricType_(word::null)
00036 {}
00037 
00038 
00039 Foam::surfZoneIdentifier::surfZoneIdentifier
00040 (
00041     const word& name,
00042     const label index,
00043     const word& geometricType
00044 )
00045 :
00046     name_(name),
00047     index_(index),
00048     geometricType_(geometricType)
00049 {}
00050 
00051 
00052 Foam::surfZoneIdentifier::surfZoneIdentifier
00053 (
00054     const word& name,
00055     const dictionary& dict,
00056     const label index
00057 )
00058 :
00059     name_(name),
00060     index_(index)
00061 {
00062     dict.readIfPresent("geometricType", geometricType_);
00063 }
00064 
00065 
00066 Foam::surfZoneIdentifier::surfZoneIdentifier
00067 (
00068     const surfZoneIdentifier& p,
00069     const label index
00070 )
00071 :
00072     name_(p.name()),
00073     index_(index),
00074     geometricType_(p.geometricType())
00075 {}
00076 
00077 
00078 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00079 
00080 Foam::surfZoneIdentifier::~surfZoneIdentifier()
00081 {}
00082 
00083 
00084 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00085 
00086 
00087 void Foam::surfZoneIdentifier::write(Ostream& os) const
00088 {
00089     if (geometricType_.size())
00090     {
00091         os.writeKeyword("geometricType") << geometricType_
00092             << token::END_STATEMENT << nl;
00093     }
00094 }
00095 
00096 
00097 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00098 
00099 // bool Foam::surfZoneIdentifier::operator!=
00100 // (
00101 //     const surfZoneIdentifier& p
00102 // ) const
00103 // {
00104 //     return !(*this == p);
00105 // }
00106 //
00107 //
00108 // bool Foam::surfZoneIdentifier::operator==
00109 // (
00110 //     const surfZoneIdentifier& p
00111 // ) const
00112 // {
00113 //     return geometricType() == p.geometricType() && name() == p.name();
00114 // }
00115 
00116 
00117 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
00118 
00119 // Foam::Istream& Foam::operator>>(Istream& is, surfZoneIdentifier& p)
00120 // {
00121 //     is >> p.name_ >> p.geometricType_;
00122 //
00123 //     return is;
00124 // }
00125 
00126 
00127 Foam::Ostream& Foam::operator<<(Ostream& os, const surfZoneIdentifier& p)
00128 {
00129     p.write(os);
00130     os.check
00131     (
00132         "Ostream& operator<<(Ostream&, const surfZoneIdentifier&)"
00133     );
00134     return os;
00135 }
00136 
00137 
00138 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines