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

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