FreeFOAM The Cross-Platform CFD Toolkit
cellInfo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::cellInfo
26 
27 Description
28  Holds information regarding type of cell. Used in inside/outside
29  determination in cellClassification.
30 
31 SourceFiles
32  cellInfoI.H
33  cellInfo.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellInfo_H
38 #define cellInfo_H
39 
40 #include <OpenFOAM/point.H>
41 #include <OpenFOAM/label.H>
42 #include <OpenFOAM/tensor.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 class polyPatch;
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class cellInfo Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class cellInfo
56 {
57  // Private data
58 
59  label type_;
60 
61  // Private Member Functions
62 
63  //- Update current cell/face type with neighbouring
64  // type. Return true if information needs to propagate,
65  // false otherwise.
66  inline bool update
67  (
68  const cellInfo& w2,
69  const label thisFaceI,
70  const label thisCellI,
71  const label neighbourFaceI,
72  const label neighbourCellI
73  );
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct null
80  inline cellInfo();
81 
82  //- Construct from cType
83  inline cellInfo(const label);
84 
85  //- Construct as copy
86  inline cellInfo(const cellInfo&);
87 
88 
89  // Member Functions
90 
91  // Access
92 
93  inline label type() const
94  {
95  return type_;
96  }
97 
98 
99  // Needed by meshWave
100 
101  //- Check whether origin has been changed at all or
102  // still contains original (invalid) value.
103  inline bool valid() const;
104 
105  //- Check for identical geometrical data. Used for cyclics checking.
106  inline bool sameGeometry
107  (
108  const polyMesh&,
109  const cellInfo&,
110  const scalar
111  ) const;
112 
113  //- Convert any absolute coordinates into relative to (patch)face
114  // centre
115  inline void leaveDomain
116  (
117  const polyMesh&,
118  const polyPatch& patch,
119  const label patchFaceI,
120  const point& faceCentre
121  );
122 
123  //- Reverse of leaveDomain
124  inline void enterDomain
125  (
126  const polyMesh&,
127  const polyPatch& patch,
128  const label patchFaceI,
129  const point& faceCentre
130  );
131 
132  //- Apply rotation matrix to any coordinates
133  inline void transform
134  (
135  const polyMesh&,
136  const tensor& rotTensor
137  );
138 
139  //- Influence of neighbouring face.
140  inline bool updateCell
141  (
142  const polyMesh&,
143  const label thisCellI,
144  const label neighbourFaceI,
145  const cellInfo& neighbourInfo,
146  const scalar tol
147  );
148 
149  //- Influence of neighbouring cell.
150  inline bool updateFace
151  (
152  const polyMesh&,
153  const label thisFaceI,
154  const label neighbourCellI,
155  const cellInfo& neighbourInfo,
156  const scalar tol
157  );
158 
159  //- Influence of different value on same face.
160  inline bool updateFace
161  (
162  const polyMesh&,
163  const label thisFaceI,
164  const cellInfo& neighbourInfo,
165  const scalar tol
166  );
167 
168  // Member Operators
169 
170  //Note: Used to determine whether to call update.
171  inline bool operator==(const cellInfo&) const;
172 
173  inline bool operator!=(const cellInfo&) const;
174 
175 
176  // IOstream Operators
177 
178  friend Ostream& operator<<(Ostream&, const cellInfo&);
179  friend Istream& operator>>(Istream&, cellInfo&);
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #include <meshTools/cellInfoI.H>
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************ vim: set sw=4 sts=4 et: ************************ //