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

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