OpenFOAM logo
Open Source CFD Toolkit

refineCell.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     refineCell
00027 
00028 Description
00029     Container with cells to refine. Refinement given as single direction.
00030 
00031 SourceFiles
00032     refineCell.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef refineCell_H
00037 #define refineCell_H
00038 
00039 #include "label.H"
00040 #include "vector.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 class Istream;
00048 class Ostream;
00049 
00050 /*---------------------------------------------------------------------------*\
00051                            Class refineCell Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class refineCell
00055 {
00056     // Private data
00057 
00058     //- Cell label
00059     label cellNo_;
00060 
00061     //- Preferred refinement direction (always normalized).
00062     vector direction_;
00063 
00064 public:
00065 
00066     // Constructors
00067 
00068         //- Null
00069         refineCell();
00070 
00071         //- from components. Vector will be normalized upon construction.
00072         refineCell(const label, const vector&);
00073 
00074         //- from Istream. Vector will be normalized upon construction.
00075         refineCell(Istream& is);
00076 
00077 
00078     // Member Functions
00079 
00080         label cellNo() const
00081         {
00082             return cellNo_;
00083         }
00084 
00085         const vector& direction() const
00086         {
00087             return direction_;
00088         }
00089 
00090 
00091     // Friend Operators
00092 
00093         inline friend bool operator==
00094         (
00095             const refineCell& rc1,
00096             const refineCell& rc2
00097         )
00098         {
00099             return (rc1.cellNo() == rc2.cellNo());
00100         }
00101 
00102         inline friend bool operator!=
00103         (
00104             const refineCell& rc1,
00105             const refineCell& rc2
00106         )
00107         {
00108             return !(rc1 == rc2);
00109         }
00110 
00111 
00112     // IOstream Operators
00113 
00114         friend Ostream& operator<<(Ostream&, const refineCell&);
00115 };
00116 
00117 
00118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00119 
00120 } // End namespace Foam
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 #endif
00125 
00126 // ************************************************************************* //
00127 
For further information go to www.openfoam.org