BUG: finiteVolume/Make/options : removed dependency on OpenFOAM. Breaks paraFoam.
[OpenFOAM-1.6.x.git] / src / meshTools / cellClassification / cellInfo.H
blobfd39cc88039a949855c31368b04f779b338af5c5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::cellInfo
28 Description
29     Holds information regarding type of cell. Used in inside/outside 
30     determination in cellClassification.
32 SourceFiles
33     cellInfoI.H
34     cellInfo.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef cellInfo_H
39 #define cellInfo_H
41 #include "point.H"
42 #include "label.H"
43 #include "tensor.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
49 class polyPatch;
50 class polyMesh;
52 /*---------------------------------------------------------------------------*\
53                            Class cellInfo Declaration
54 \*---------------------------------------------------------------------------*/
56 class cellInfo
58     // Private data
60         label type_;
61         
62     // Private Member Functions
64         //- Update current cell/face type with neighbouring
65         //  type. Return true if information needs to propagate,
66         //  false otherwise.
67         inline bool update
68         (
69             const cellInfo& w2,
70             const label thisFaceI,
71             const label thisCellI,
72             const label neighbourFaceI,
73             const label neighbourCellI
74         );
76 public:
78     // Constructors
80         //- Construct null
81         inline cellInfo();
83         //- Construct from cType
84         inline cellInfo(const label);
86         //- Construct as copy
87         inline cellInfo(const cellInfo&);
90     // Member Functions
92         // Access
94             inline label type() const
95             {
96                 return type_;
97             }
100         // Needed by meshWave
102             //- Check whether origin has been changed at all or
103             //  still contains original (invalid) value.
104             inline bool valid() const;
106             //- Check for identical geometrical data. Used for cyclics checking.
107             inline bool sameGeometry
108             (
109                 const polyMesh&,
110                 const cellInfo&,
111                 const scalar
112             ) const;
114             //- Convert any absolute coordinates into relative to (patch)face
115             //  centre
116             inline void leaveDomain
117             (
118                 const polyMesh&,
119                 const polyPatch& patch,
120                 const label patchFaceI,
121                 const point& faceCentre
122             );
124             //- Reverse of leaveDomain
125             inline void enterDomain
126             (
127                 const polyMesh&,
128                 const polyPatch& patch,
129                 const label patchFaceI,
130                 const point& faceCentre
131             );
133             //- Apply rotation matrix to any coordinates
134             inline void transform
135             (
136                 const polyMesh&,
137                 const tensor& rotTensor
138             );
140             //- Influence of neighbouring face.
141             inline bool updateCell
142             (
143                 const polyMesh&,
144                 const label thisCellI,
145                 const label neighbourFaceI,
146                 const cellInfo& neighbourInfo,
147                 const scalar tol
148             );
150             //- Influence of neighbouring cell.
151             inline bool updateFace
152             (
153                 const polyMesh&,
154                 const label thisFaceI,
155                 const label neighbourCellI,
156                 const cellInfo& neighbourInfo,
157                 const scalar tol
158             );
160             //- Influence of different value on same face.
161             inline bool updateFace
162             (
163                 const polyMesh&,
164                 const label thisFaceI,
165                 const cellInfo& neighbourInfo,
166                 const scalar tol
167             );
169     // Member Operators
171         //Note: Used to determine whether to call update.
172         inline bool operator==(const cellInfo&) const;
174         inline bool operator!=(const cellInfo&) const;
177     // IOstream Operators
179         friend Ostream& operator<<(Ostream&, const cellInfo&);
180         friend Istream& operator>>(Istream&, cellInfo&);
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 } // End namespace Foam
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 #include "cellInfoI.H"
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #endif
196 // ************************************************************************* //