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

geometricSurfacePatch.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::geometricSurfacePatch
00027 
00028 Description
00029     The geometricSurfacePatch is like patchIdentifier but for surfaces.
00030     Holds type, name and index.
00031 
00032 SourceFiles
00033     geometricSurfacePatch.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef geometricSurfacePatch_H
00038 #define geometricSurfacePatch_H
00039 
00040 #include "word.H"
00041 #include "label.H"
00042 #include "typeInfo.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class dictionary;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class geometricSurfacePatch Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class geometricSurfacePatch
00056 {
00057     // Private data
00058 
00059         //- Type name of patch
00060         word geometricType_;
00061 
00062         //- Name of patch
00063         word name_;
00064 
00065         //- Index of patch in boundary
00066         label index_;
00067 
00068 public:
00069 
00070     //- Runtime type information
00071     ClassName("geometricSurfacePatch");
00072 
00073 
00074     // Constructors
00075 
00076         //- Construct null
00077         geometricSurfacePatch();
00078 
00079         //- Construct from components
00080         geometricSurfacePatch
00081         (
00082             const word& geometricType,
00083             const word& name,
00084             const label index
00085         );
00086 
00087         //- Construct from Istream
00088         geometricSurfacePatch(Istream&, const label index);
00089 
00090         //- Construct from dictionary
00091         geometricSurfacePatch
00092         (
00093             const word& name,
00094             const dictionary& dict,
00095             const label index
00096         );
00097 
00098 
00099     // Member Functions
00100 
00101         //- Return name
00102         const word& name() const
00103         {
00104             return name_;
00105         }
00106 
00107         //- Return name
00108         word& name()
00109         {
00110             return name_;
00111         }
00112 
00113         //- Return the type of the patch
00114         const word& geometricType() const
00115         {
00116             return geometricType_;
00117         }
00118 
00119         //- Return the type of the patch
00120         word& geometricType()
00121         {
00122             return geometricType_;
00123         }
00124 
00125         //- Return the index of this patch in the boundaryMesh
00126         label index() const
00127         {
00128             return index_;
00129         }
00130 
00131         //- Write
00132         void write(Ostream&) const;
00133 
00134         //- Write dictionary
00135         void writeDict(Ostream&) const;
00136 
00137 
00138     // Member Operators
00139 
00140         bool operator!=(const geometricSurfacePatch&) const;
00141 
00142         //- compare.
00143         bool operator==(const geometricSurfacePatch&) const;
00144 
00145 
00146     // Ostream Operator
00147 
00148         friend Ostream& operator<<(Ostream&, const geometricSurfacePatch&);
00149         friend Istream& operator>>(Istream&, geometricSurfacePatch&);
00150 };
00151 
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 } // End namespace Foam
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 #endif
00160 
00161 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd