FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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