OpenFOAM logo
Open Source CFD Toolkit

surfacePatch.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-2005 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     surfacePatch
00027 
00028 Description
00029     'Patch' on surface as subset of triSurface.
00030 
00031 SourceFiles
00032     surfacePatch.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef surfacePatch_H
00037 #define surfacePatch_H
00038 
00039 #include "geometricSurfacePatch.H"
00040 #include "word.H"
00041 #include "label.H"
00042 #include "className.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                            Class surfacePatch Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class surfacePatch
00054 :
00055     public geometricSurfacePatch
00056 {
00057     // Private data
00058 
00059         //- size of this patch in the triSurface face list
00060         label size_;
00061 
00062         //- Start label of this patch in the triSurface face list
00063         label start_;
00064 
00065 public:
00066 
00067     //- Runtime type information
00068     ClassName("surfacePatch");
00069 
00070 
00071     // Constructors
00072 
00073         //- Construct null
00074         surfacePatch();
00075 
00076         //- Construct from components
00077         surfacePatch
00078         (
00079             const word& geometricType,
00080             const word& name,
00081             const label size,
00082             const label start,
00083             const label index
00084         );
00085 
00086         //- Construct from Istream
00087         surfacePatch(Istream& is, const label index);
00088 
00089         //- Construct from dictionary
00090         surfacePatch
00091         (
00092             const word& name,
00093             const dictionary& dict,
00094             const label index
00095         );
00096 
00097         //- Construct as copy
00098         surfacePatch(const surfacePatch&);
00099 
00100 
00101     // Member Functions
00102 
00103         //- Return start label of this patch in the polyMesh face list
00104         label start() const
00105         {
00106             return start_;
00107         }
00108 
00109         //- Return start label of this patch in the polyMesh face list
00110         label& start()
00111         {
00112             return start_;
00113         }
00114 
00115         //- Return size of this patch in the polyMesh face list
00116         label size() const
00117         {
00118             return size_;
00119         }
00120 
00121         //- Return size of this patch in the polyMesh face list
00122         label& size()
00123         {
00124             return size_;
00125         }
00126 
00127         //- Write
00128         void write(Ostream&) const;
00129 
00130         //- Write dictionary
00131         void writeDict(Ostream&) const;
00132 
00133 
00134     // Member Operators
00135 
00136         bool operator!=(const surfacePatch&) const;
00137 
00138         //- compare.
00139         bool operator==(const surfacePatch&) const;
00140 
00141     // IOstream Operators
00142 
00143         friend Ostream& operator<<(Ostream&, const surfacePatch&);
00144 };
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 #endif
00154 
00155 // ************************************************************************* //
For further information go to www.openfoam.org