OpenFOAM logo
Open Source CFD Toolkit

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