cellInfo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 
49 // Forward declaration of classes
50 class polyPatch;
51 class polyMesh;
52 class transformer;
53 
54 
55 // Forward declaration of friend functions and operators
56 
57 class cellInfo;
58 
59 Istream& operator>>(Istream&, cellInfo&);
60 Ostream& operator<<(Ostream&, const cellInfo&);
61 
62 
63 /*---------------------------------------------------------------------------*\
64  Class cellInfo Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class cellInfo
68 {
69  // Private Data
70 
71  label type_;
72 
73  // Private Member Functions
74 
75  //- Update current cell/face type with neighbouring
76  // type. Return true if information needs to propagate,
77  // false otherwise.
78  template<class TrackingData>
79  inline bool update
80  (
81  const cellInfo& w2,
82  const label thisFacei,
83  const label thisCelli,
84  const label neighbourFacei,
85  const label neighbourCelli,
86  TrackingData& td
87  );
88 
89 public:
90 
91  // Constructors
92 
93  //- Construct null
94  inline cellInfo();
95 
96  //- Construct from cType
97  inline cellInfo(const label);
98 
99 
100  // Member Functions
101 
102  // Access
103 
104  inline label type() const
105  {
106  return type_;
107  }
108 
109 
110  // Needed by meshWave
111 
112  //- Check whether origin has been changed at all or
113  // still contains original (invalid) value.
114  template<class TrackingData>
115  inline bool valid(TrackingData& td) const;
116 
117  //- Check for identical geometrical data. Used for cyclics checking.
118  template<class TrackingData>
119  inline bool sameGeometry
120  (
121  const polyMesh&,
122  const cellInfo&,
123  const scalar,
124  TrackingData& td
125  ) const;
126 
127  //- Transform across an interface
128  template<class TrackingData>
129  inline void transform
130  (
131  const polyPatch& patch,
132  const label patchFacei,
133  const transformer& transform,
134  TrackingData& td
135  );
136 
137  //- Influence of neighbouring face.
138  template<class TrackingData>
139  inline bool updateCell
140  (
141  const polyMesh&,
142  const label thisCelli,
143  const label neighbourFacei,
144  const cellInfo& neighbourInfo,
145  const scalar tol,
146  TrackingData& td
147  );
148 
149  //- Influence of neighbouring cell.
150  template<class TrackingData>
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  TrackingData& td
159  );
160 
161  //- Influence of different value on same face.
162  template<class TrackingData>
163  inline bool updateFace
164  (
165  const polyMesh&,
166  const label thisFacei,
167  const cellInfo& neighbourInfo,
168  const scalar tol,
169  TrackingData& td
170  );
171 
172  //- Same (like operator==)
173  template<class TrackingData>
174  inline bool equal(const cellInfo&, TrackingData& td) const;
175 
176  // Member Operators
177 
178  // Note: Used to determine whether to call update.
179  inline bool operator==(const cellInfo&) const;
180 
181  inline bool operator!=(const cellInfo&) const;
182 
183 
184  // IOstream Operators
185 
186  friend Ostream& operator<<(Ostream&, const cellInfo&);
187  friend Istream& operator>>(Istream&, cellInfo&);
188 };
189 
190 
191 //- Data associated with cellInfo type are contiguous
192 template<>
193 inline bool contiguous<cellInfo>()
194 {
195  return true;
196 }
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #include "cellInfoI.H"
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
Definition: cellInfo.H:67
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:143
bool equal(const cellInfo &, TrackingData &td) const
Same (like operator==)
Definition: cellInfoI.H:211
bool operator==(const cellInfo &) const
Definition: cellInfoI.H:222
cellInfo()
Construct null.
Definition: cellInfoI.H:95
bool operator!=(const cellInfo &) const
Definition: cellInfoI.H:228
friend Ostream & operator<<(Ostream &, const cellInfo &)
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:166
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: cellInfoI.H:110
friend Istream & operator>>(Istream &, cellInfo &)
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Definition: cellInfoI.H:132
label type() const
Definition: cellInfo.H:103
bool sameGeometry(const polyMesh &, const cellInfo &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
Definition: cellInfoI.H:118
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
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
Istream & operator>>(Istream &, pistonPointEdgeData &)
bool contiguous< cellInfo >()
Data associated with cellInfo type are contiguous.
Definition: cellInfo.H:192
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)