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

cellInfo.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::cellInfo
00027 
00028 Description
00029     Holds information regarding type of cell. Used in inside/outside 
00030     determination in cellClassification.
00031 
00032 SourceFiles
00033     cellInfoI.H
00034     cellInfo.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef cellInfo_H
00039 #define cellInfo_H
00040 
00041 #include "point.H"
00042 #include "label.H"
00043 #include "tensor.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 class polyPatch;
00050 class polyMesh;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class cellInfo Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class cellInfo
00057 {
00058     // Private data
00059 
00060         label type_;
00061         
00062     // Private Member Functions
00063 
00064         //- Update current cell/face type with neighbouring
00065         //  type. Return true if information needs to propagate,
00066         //  false otherwise.
00067         inline bool update
00068         (
00069             const cellInfo& w2,
00070             const label thisFaceI,
00071             const label thisCellI,
00072             const label neighbourFaceI,
00073             const label neighbourCellI
00074         );
00075 
00076 public:
00077 
00078     // Constructors
00079 
00080         //- Construct null
00081         inline cellInfo();
00082 
00083         //- Construct from cType
00084         inline cellInfo(const label);
00085 
00086         //- Construct as copy
00087         inline cellInfo(const cellInfo&);
00088 
00089 
00090     // Member Functions
00091 
00092         // Access
00093 
00094             inline label type() const
00095             {
00096                 return type_;
00097             }
00098 
00099 
00100         // Needed by meshWave
00101 
00102             //- Check whether origin has been changed at all or
00103             //  still contains original (invalid) value.
00104             inline bool valid() const;
00105 
00106             //- Check for identical geometrical data. Used for cyclics checking.
00107             inline bool sameGeometry
00108             (
00109                 const polyMesh&,
00110                 const cellInfo&,
00111                 const scalar
00112             ) const;
00113 
00114             //- Convert any absolute coordinates into relative to (patch)face
00115             //  centre
00116             inline void leaveDomain
00117             (
00118                 const polyMesh&,
00119                 const polyPatch& patch,
00120                 const label patchFaceI,
00121                 const point& faceCentre
00122             );
00123 
00124             //- Reverse of leaveDomain
00125             inline void enterDomain
00126             (
00127                 const polyMesh&,
00128                 const polyPatch& patch,
00129                 const label patchFaceI,
00130                 const point& faceCentre
00131             );
00132 
00133             //- Apply rotation matrix to any coordinates
00134             inline void transform
00135             (
00136                 const polyMesh&,
00137                 const tensor& rotTensor
00138             );
00139 
00140             //- Influence of neighbouring face.
00141             inline bool updateCell
00142             (
00143                 const polyMesh&,
00144                 const label thisCellI,
00145                 const label neighbourFaceI,
00146                 const cellInfo& neighbourInfo,
00147                 const scalar tol
00148             );
00149 
00150             //- Influence of neighbouring cell.
00151             inline bool updateFace
00152             (
00153                 const polyMesh&,
00154                 const label thisFaceI,
00155                 const label neighbourCellI,
00156                 const cellInfo& neighbourInfo,
00157                 const scalar tol
00158             );
00159 
00160             //- Influence of different value on same face.
00161             inline bool updateFace
00162             (
00163                 const polyMesh&,
00164                 const label thisFaceI,
00165                 const cellInfo& neighbourInfo,
00166                 const scalar tol
00167             );
00168 
00169     // Member Operators
00170 
00171         //Note: Used to determine whether to call update.
00172         inline bool operator==(const cellInfo&) const;
00173 
00174         inline bool operator!=(const cellInfo&) const;
00175 
00176 
00177     // IOstream Operators
00178 
00179         friend Ostream& operator<<(Ostream&, const cellInfo&);
00180         friend Istream& operator>>(Istream&, cellInfo&);
00181 };
00182 
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 } // End namespace Foam
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 #include "cellInfoI.H"
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 #endif
00195 
00196 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd