OpenFOAM logo
Open Source CFD Toolkit

cell.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     cell
00027 
00028 Description
00029     A cell is defined as a list of faces with extra functionality
00030 
00031 SourceFiles
00032     cellI.H
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef cell_H
00037 #define cell_H
00038 
00039 #include "labelList.H"
00040 #include "pointField.H"
00041 #include "edgeList.H"
00042 #include "faceList.H"
00043 #include "autoPtr.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 class oppositeFace;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class cell Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class cell
00057 :
00058     public labelList
00059 {
00060 
00061 public:
00062 
00063     // Constructors
00064 
00065         //- Construct null
00066         inline cell();
00067 
00068         //- Construct given size
00069         explicit inline cell(label);
00070 
00071         //- Construct from components
00072         explicit inline cell(const labelList& f);
00073 
00074         //- Construct from Istream
00075         inline cell(Istream&);
00076 
00077 
00078     // Member Functions
00079 
00080         //- Return number of faces
00081         inline label nFaces() const;
00082 
00083         //- Return labels of cell vertices
00084         labelList labels(const unallocFaceList&) const;
00085 
00086         //- Return the cell vertices
00087         pointField points(const unallocFaceList&, const pointField&) const;
00088 
00089         //- Return cell edges
00090         edgeList edges(const unallocFaceList&) const;
00091 
00092         //- Return index of opposite face
00093         label opposingFaceLabel
00094         (
00095             const label masterFaceLabel,
00096             const unallocFaceList& meshFaces
00097         ) const;
00098 
00099         //- Return opposite face oriented the same way as the master face
00100         oppositeFace opposingFace
00101         (
00102             const label masterFaceLabel,
00103             const unallocFaceList& meshFaces
00104         ) const;
00105 
00106 
00107         // Instructions for centre and mag:
00108         // When one wants to access the cell centre and magnitude, the
00109         // functionality on the mesh level should be used in preference to the
00110         // functions provided here. They do not rely to the functionality
00111         // implemented here, provide additional checking and are more efficient.
00112         // The cell::centre and cell::mag functions may be removed in the
00113         // future.
00114 
00115         //- Returns cell centre
00116         point centre(const pointField&, const unallocFaceList&) const;
00117 
00118         //- Returns cell volume
00119         scalar mag(const pointField&, const unallocFaceList&) const;
00120 
00121 
00122     // Friend Operators
00123 
00124         friend bool operator==(const cell&, const cell&);
00125         inline friend bool operator!=(const cell&, const cell&);
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace Foam
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #include "cellI.H"
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 #endif
00140 
00141 // ************************************************************************* //
For further information go to www.openfoam.org