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

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