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