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

surfZoneIdentifier.H

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 Class
00026     Foam::surfZoneIdentifier
00027 
00028 Description
00029     An identifier for a surface zone on a meshed surface.
00030 
00031     Similar in concept to a faceZone on the surface, but can also have a
00032     "geometricType" as well.
00033 
00034 SourceFiles
00035     surfZoneIdentifier.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef surfZoneIdentifier_H
00040 #define surfZoneIdentifier_H
00041 
00042 #include "word.H"
00043 #include "label.H"
00044 #include "typeInfo.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 class dictionary;
00052 
00053 // Forward declaration of friend functions and operators
00054 
00055 class surfZoneIdentifier;
00056 Ostream& operator<<(Ostream&, const surfZoneIdentifier&);
00057 
00058 /*---------------------------------------------------------------------------*\
00059                     Class surfZoneIdentifier Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 class surfZoneIdentifier
00063 {
00064     // Private data
00065 
00066         //- Name of zone
00067         word name_;
00068 
00069         //- Index of zone in surface mesh
00070         label index_;
00071 
00072         //- Type name of zone
00073         mutable word geometricType_;
00074 
00075 
00076 public:
00077 
00078     // Constructors
00079 
00080         //- Construct null
00081         surfZoneIdentifier();
00082 
00083         //- Construct from components
00084         surfZoneIdentifier
00085         (
00086             const word& name,
00087             const label index,
00088             const word& geometricType = word::null
00089 
00090         );
00091 
00092         //- Construct from dictionary
00093         surfZoneIdentifier
00094         (
00095             const word& name,
00096             const dictionary&,
00097             const label index
00098         );
00099 
00100         //- Construct from another zone identifier, resetting the index
00101         surfZoneIdentifier
00102         (
00103             const surfZoneIdentifier&,
00104             const label index
00105         );
00106 
00107 
00108     // Destructor
00109 
00110         virtual ~surfZoneIdentifier();
00111 
00112 
00113     // Member Functions
00114 
00115         //- Return name
00116         const word& name() const
00117         {
00118             return name_;
00119         }
00120 
00121         //- Return name for modification
00122         word& name()
00123         {
00124             return name_;
00125         }
00126 
00127         //- Return the geometric type of the zone
00128         const word& geometricType() const
00129         {
00130             return geometricType_;
00131         }
00132 
00133         //- Return the geometric type of the zone for modification
00134         word& geometricType()
00135         {
00136             return geometricType_;
00137         }
00138 
00139         //- Return the index of this zone in the surface mesh
00140         label index() const
00141         {
00142             return index_;
00143         }
00144 
00145         //- Write surfZoneIdentifier as a dictionary
00146         void write(Ostream&) const;
00147 
00148         //- Write surfZoneIdentifier as a dictionary
00149 //        void writeDict(Ostream&) const;
00150 
00151 
00152     // Member Operators
00153 
00154 //        bool operator!=(const surfZoneIdentifier&) const;
00155 //
00156 //        //- compare.
00157 //        bool operator==(const surfZoneIdentifier&) const;
00158 
00159     // Ostream Operator
00160 
00161         friend Ostream& operator<<(Ostream&, const surfZoneIdentifier&);
00162 //        friend Istream& operator>>(Istream&, surfZoneIdentifier&);
00163 };
00164 
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 } // End namespace Foam
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd