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) 2011 OpenFOAM Foundation
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 "point.H"
41 #include "label.H"
42 #include "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  template<class TrackingData>
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  TrackingData& td
75  );
76 
77 public:
78 
79  // Constructors
80 
81  //- Construct null
82  inline cellInfo();
83 
84  //- Construct from cType
85  inline cellInfo(const label);
86 
87  //- Construct as copy
88  inline cellInfo(const cellInfo&);
89 
90 
91  // Member Functions
92 
93  // Access
94 
95  inline label type() const
96  {
97  return type_;
98  }
99 
100 
101  // Needed by meshWave
102 
103  //- Check whether origin has been changed at all or
104  // still contains original (invalid) value.
105  template<class TrackingData>
106  inline bool valid(TrackingData& td) const;
107 
108  //- Check for identical geometrical data. Used for cyclics checking.
109  template<class TrackingData>
110  inline bool sameGeometry
111  (
112  const polyMesh&,
113  const cellInfo&,
114  const scalar,
115  TrackingData& td
116  ) const;
117 
118  //- Convert any absolute coordinates into relative to (patch)face
119  // centre
120  template<class TrackingData>
121  inline void leaveDomain
122  (
123  const polyMesh&,
124  const polyPatch& patch,
125  const label patchFaceI,
126  const point& faceCentre,
127  TrackingData& td
128  );
129 
130  //- Reverse of leaveDomain
131  template<class TrackingData>
132  inline void enterDomain
133  (
134  const polyMesh&,
135  const polyPatch& patch,
136  const label patchFaceI,
137  const point& faceCentre,
138  TrackingData& td
139  );
140 
141  //- Apply rotation matrix to any coordinates
142  template<class TrackingData>
143  inline void transform
144  (
145  const polyMesh&,
146  const tensor& rotTensor,
147  TrackingData& td
148  );
149 
150  //- Influence of neighbouring face.
151  template<class TrackingData>
152  inline bool updateCell
153  (
154  const polyMesh&,
155  const label thisCellI,
156  const label neighbourFaceI,
157  const cellInfo& neighbourInfo,
158  const scalar tol,
159  TrackingData& td
160  );
161 
162  //- Influence of neighbouring cell.
163  template<class TrackingData>
164  inline bool updateFace
165  (
166  const polyMesh&,
167  const label thisFaceI,
168  const label neighbourCellI,
169  const cellInfo& neighbourInfo,
170  const scalar tol,
171  TrackingData& td
172  );
173 
174  //- Influence of different value on same face.
175  template<class TrackingData>
176  inline bool updateFace
177  (
178  const polyMesh&,
179  const label thisFaceI,
180  const cellInfo& neighbourInfo,
181  const scalar tol,
182  TrackingData& td
183  );
184 
185  //- Same (like operator==)
186  template<class TrackingData>
187  inline bool equal(const cellInfo&, TrackingData& td) const;
188 
189  // Member Operators
190 
191  //Note: Used to determine whether to call update.
192  inline bool operator==(const cellInfo&) const;
193 
194  inline bool operator!=(const cellInfo&) const;
195 
196 
197  // IOstream Operators
198 
199  friend Ostream& operator<<(Ostream&, const cellInfo&);
200  friend Istream& operator>>(Istream&, cellInfo&);
201 };
202 
203 
204 //- Data associated with cellInfo type are contiguous
205 template<>
206 inline bool contiguous<cellInfo>()
207 {
208  return true;
209 }
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #include "cellInfoI.H"
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
Foam::cellInfo::updateFace
bool updateFace(const polyMesh &, const label thisFaceI, const label neighbourCellI, const cellInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: cellInfoI.H:204
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::cellInfo::update
bool update(const cellInfo &w2, const label thisFaceI, const label thisCellI, const label neighbourFaceI, const label neighbourCellI, TrackingData &td)
Update current cell/face type with neighbouring.
Definition: cellInfoI.H:34
Foam::cellInfo::operator<<
friend Ostream & operator<<(Ostream &, const cellInfo &)
point.H
Foam::cellInfo::leaveDomain
void leaveDomain(const polyMesh &, const polyPatch &patch, const label patchFaceI, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
Definition: cellInfoI.H:143
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::cellInfo::sameGeometry
bool sameGeometry(const polyMesh &, const cellInfo &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
Definition: cellInfoI.H:128
Foam::cellInfo::transform
void transform(const polyMesh &, const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition: cellInfoI.H:156
Foam::cellInfo::enterDomain
void enterDomain(const polyMesh &, const polyPatch &patch, const label patchFaceI, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: cellInfoI.H:167
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::cellInfo::updateCell
bool updateCell(const polyMesh &, const label thisCellI, const label neighbourFaceI, const cellInfo &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: cellInfoI.H:180
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::cellInfo::type
label type() const
Definition: cellInfo.H:94
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::contiguous< cellInfo >
bool contiguous< cellInfo >()
Data associated with cellInfo type are contiguous.
Definition: cellInfo.H:205
Foam::cellInfo
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
Definition: cellInfo.H:54
Foam::cellInfo::operator==
bool operator==(const cellInfo &) const
Definition: cellInfoI.H:260
Foam::Vector< scalar >
label.H
Foam::cellInfo::valid
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: cellInfoI.H:119
Foam::cellInfo::cellInfo
cellInfo()
Construct null.
Definition: cellInfoI.H:96
Foam::cellInfo::operator>>
friend Istream & operator>>(Istream &, cellInfo &)
cellInfoI.H
Foam::cellInfo::operator!=
bool operator!=(const cellInfo &) const
Definition: cellInfoI.H:266
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cellInfo::type_
label type_
Definition: cellInfo.H:58
Foam::cellInfo::equal
bool equal(const cellInfo &, TrackingData &td) const
Same (like operator==)
Definition: cellInfoI.H:249