minData.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) 2014-2019 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::minData
26 
27 Description
28  For use with FaceCellWave. Transports minimum passive data
29 
30 SourceFiles
31  minDataI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef minData_H
36 #define minData_H
37 
38 #include "point.H"
39 #include "tensor.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class polyPatch;
47 class polyMesh;
48 
49 
50 // Forward declaration of friend functions and operators
51 
52 class minData;
53 
54 Istream& operator>>(Istream&, minData&);
55 Ostream& operator<<(Ostream&, const minData&);
56 
57 
58 /*---------------------------------------------------------------------------*\
59  Class minData Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class minData
63 {
64  // Private Data
65 
66  //- Starting data
67  label data_;
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct null
75  inline minData();
76 
77  //- Construct from count
78  inline minData(const label data);
79 
80 
81  // Member Functions
82 
83  // Access
84 
85  inline label data() const
86  {
87  return data_;
88  }
89 
90 
91  // Needed by FaceCellWave
92 
93  //- Check whether origin has been changed at all or
94  // still contains original (invalid) value.
95  template<class TrackingData>
96  inline bool valid(TrackingData& td) const;
97 
98  //- Check for identical geometrical data. Used for cyclics checking.
99  template<class TrackingData>
100  inline bool sameGeometry
101  (
102  const polyMesh&,
103  const minData&,
104  const scalar,
105  TrackingData& td
106  ) const;
107 
108  //- Convert any absolute coordinates into relative to (patch)face
109  // centre
110  template<class TrackingData>
111  inline void leaveDomain
112  (
113  const polyMesh&,
114  const polyPatch&,
115  const label patchFacei,
116  const point& faceCentre,
117  TrackingData& td
118  );
119 
120  //- Reverse of leaveDomain
121  template<class TrackingData>
122  inline void enterDomain
123  (
124  const polyMesh&,
125  const polyPatch&,
126  const label patchFacei,
127  const point& faceCentre,
128  TrackingData& td
129  );
130 
131  //- Apply rotation matrix to any coordinates
132  template<class TrackingData>
133  inline void transform
134  (
135  const polyMesh&,
136  const tensor&,
137  TrackingData& td
138  );
139 
140  //- Influence of neighbouring face.
141  template<class TrackingData>
142  inline bool updateCell
143  (
144  const polyMesh&,
145  const label thisCelli,
146  const label neighbourFacei,
147  const minData& neighbourInfo,
148  const scalar tol,
149  TrackingData& td
150  );
151 
152  //- Influence of neighbouring cell.
153  template<class TrackingData>
154  inline bool updateFace
155  (
156  const polyMesh&,
157  const label thisFacei,
158  const label neighbourCelli,
159  const minData& neighbourInfo,
160  const scalar tol,
161  TrackingData& td
162  );
163 
164  //- Influence of different value on same face.
165  template<class TrackingData>
166  inline bool updateFace
167  (
168  const polyMesh&,
169  const label thisFacei,
170  const minData& neighbourInfo,
171  const scalar tol,
172  TrackingData& td
173  );
174 
175  //- Same (like operator==)
176  template<class TrackingData>
177  inline bool equal(const minData&, TrackingData& td) const;
178 
179  // Member Operators
180 
181  // Needed for List IO
182  inline bool operator==(const minData&) const;
183 
184  inline bool operator!=(const minData&) const;
185 
186 
187  // IOstream Operators
188 
189  friend Ostream& operator<<(Ostream&, const minData&);
190  friend Istream& operator>>(Istream&, minData&);
191 };
192 
193 
194 //- Data associated with minData type are contiguous
195 template<>
196 inline bool contiguous<minData>()
197 {
198  return true;
199 }
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #include "minDataI.H"
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: minDataI.H:88
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
friend Ostream & operator<<(Ostream &, const minData &)
bool operator!=(const minData &) const
Definition: minDataI.H:192
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition: minDataI.H:78
bool sameGeometry(const polyMesh &, const minData &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
Definition: minDataI.H:53
bool operator==(const minData &) const
Definition: minDataI.H:183
bool updateFace(const polyMesh &, const label thisFacei, const label neighbourCelli, const minData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: minDataI.H:123
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Database for solution and other reduced data.
Definition: data.H:51
minData()
Construct null.
Definition: minDataI.H:30
label data() const
Definition: minData.H:84
friend Istream & operator>>(Istream &, minData &)
Ostream & operator<<(Ostream &, const ensightPart &)
bool contiguous< minData >()
Data associated with minData type are contiguous.
Definition: minData.H:195
bool equal(const minData &, TrackingData &td) const
Same (like operator==)
Definition: minDataI.H:171
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: minDataI.H:45
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
bool updateCell(const polyMesh &, const label thisCelli, const label neighbourFacei, const minData &neighbourInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: minDataI.H:100
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face.
Definition: minDataI.H:66
For use with FaceCellWave. Transports minimum passive data.
Definition: minData.H:61
Namespace for OpenFOAM.