OpenFOAM logo
Open Source CFD Toolkit

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