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

surfZone.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::surfZone
00027 
00028 Description
00029     A surface zone on a MeshedSurface.
00030 
00031     Similar in concept to a faceZone, but the face list is contiguous.
00032 
00033 SourceFiles
00034     surfZone.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef surfZone_H
00039 #define surfZone_H
00040 
00041 #include "word.H"
00042 #include "label.H"
00043 #include "className.H"
00044 #include "surfZoneIdentifier.H"
00045 #include "autoPtr.H"
00046 #include "dictionary.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 // Forward declaration of friend functions and operators
00054 
00055 class surfZone;
00056 
00057 Istream& operator>>(Istream&, surfZone&);
00058 Ostream& operator<<(Ostream&, const surfZone&);
00059 
00060 /*---------------------------------------------------------------------------*\
00061                           Class surfZone Declaration
00062 \*---------------------------------------------------------------------------*/
00063 
00064 class surfZone
00065 :
00066     public surfZoneIdentifier
00067 {
00068     // Private data
00069 
00070         //- size of this group in the face list
00071         label size_;
00072 
00073         //- Start label of this group in the face list
00074         label start_;
00075 
00076 
00077 public:
00078 
00079     //- Runtime type information
00080     ClassName("surfZone");
00081 
00082 
00083     // Constructors
00084 
00085         //- Construct null
00086         surfZone();
00087 
00088         //- Construct from components
00089         surfZone
00090         (
00091             const word& name,
00092             const label size,
00093             const label start,
00094             const label index,
00095             const word& geometricType = word::null
00096         );
00097 
00098         //- Construct from Istream
00099         surfZone(Istream& is, const label index);
00100 
00101         //- Construct from dictionary
00102         surfZone
00103         (
00104             const word& name,
00105             const dictionary& dict,
00106             const label index
00107         );
00108 
00109         //- Construct as copy
00110         surfZone(const surfZone&);
00111 
00112         //- Construct from another zone, resetting the index
00113         surfZone(const surfZone&, const label index);
00114 
00115         //- Return clone
00116         autoPtr<surfZone> clone() const
00117         {
00118             notImplemented("autoPtr<surfZone> clone() const");
00119             return autoPtr<surfZone>(NULL);
00120         }
00121 
00122         static autoPtr<surfZone> New(Istream& is)
00123         {
00124             word name(is);
00125             dictionary dict(is);
00126 
00127             return autoPtr<surfZone>(new surfZone(name, dict, 0));
00128         }
00129 
00130 
00131     // Member Functions
00132 
00133         //- Return start label of this zone in the face list
00134         label start() const
00135         {
00136             return start_;
00137         }
00138 
00139         //- Return start label of this zone in the face list
00140         label& start()
00141         {
00142             return start_;
00143         }
00144 
00145         //- Return size of this zone in the face list
00146         label size() const
00147         {
00148             return size_;
00149         }
00150 
00151         //- Return size of this zone in the face list
00152         label& size()
00153         {
00154             return size_;
00155         }
00156 
00157         //- Write
00158         void write(Ostream&) const;
00159 
00160         //- Write dictionary
00161         void writeDict(Ostream&) const;
00162 
00163 
00164     // Member Operators
00165 
00166         bool operator!=(const surfZone&) const;
00167 
00168         //- compare.
00169         bool operator==(const surfZone&) const;
00170 
00171 
00172     // IOstream Operators
00173 
00174         friend Istream& operator>>(Istream&, surfZone&);
00175         friend Ostream& operator<<(Ostream&, const surfZone&);
00176 };
00177 
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 } // End namespace Foam
00182 
00183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00184 
00185 #endif
00186 
00187 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd