OpenFOAM logo
Open Source CFD Toolkit

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