minDataI.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2014-2016 OpenFOAM Foundation
9 Copyright (C) 2015-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "polyMesh.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
34:
35 data_(labelMax)
36{}
37
38
39inline Foam::minData::minData(const label data)
40:
41 data_(data)
42{}
43
44
45// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
46
47template<class TrackingData>
48inline bool Foam::minData::valid(TrackingData& td) const
49{
50 return data_ != labelMax;
51}
52
53
54template<class TrackingData>
56(
57 const polyMesh&,
58 const minData&,
59 const scalar,
60 TrackingData&
61) const
62{
63 return true;
64}
65
66
67template<class TrackingData>
69(
70 const polyMesh&,
71 const polyPatch& patch,
72 const label patchFacei,
73 const point& faceCentre,
74 TrackingData&
75)
76{}
77
78
79template<class TrackingData>
81(
82 const polyMesh&,
83 const tensor& rotTensor,
84 TrackingData&
85)
86{}
87
88
89template<class TrackingData>
91(
92 const polyMesh&,
93 const polyPatch& patch,
94 const label patchFacei,
95 const point& faceCentre,
96 TrackingData&
97)
98{}
99
100
101template<class TrackingData>
103(
104 const polyMesh&,
105 const label thisCelli,
106 const label neighbourFacei,
107 const minData& neighbourInfo,
108 const scalar tol,
109 TrackingData&
110)
111{
112 if (neighbourInfo.data_ < data_)
113 {
114 operator=(neighbourInfo);
115 return true;
116 }
117
118 return false;
119}
120
121
122template<class TrackingData>
124(
125 const polyMesh& mesh,
126 const label thisFacei,
127 const label neighbourCelli,
128 const minData& neighbourInfo,
129 const scalar tol,
130 TrackingData&
131)
132{
133 // From cell to its faces.
134 if (neighbourInfo.data_ < data_)
135 {
136 operator=(neighbourInfo);
137 return true;
138 }
139
140 return false;
141}
142
143
144template<class TrackingData>
146(
147 const polyMesh&,
148 const label thisFacei,
149 const minData& neighbourInfo,
150 const scalar tol,
151 TrackingData&
152)
153{
154 // From face to face (e.g. coupled faces)
155 if (neighbourInfo.data_ < data_)
156 {
157 operator=(neighbourInfo);
158 return true;
159 }
160
161 return false;
162}
163
164
165template<class TrackingData>
167(
168 const minData& rhs,
169 TrackingData& td
170) const
171{
172 return operator==(rhs);
173}
174
175
176// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
177
179(
180 const minData& rhs
181) const
182{
183 return data_ == rhs.data_;
184}
185
186
188(
189 const minData& rhs
190) const
191{
192 return !(*this == rhs);
193}
194
195
196// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
197
198inline Foam::Ostream& Foam::operator<<
199(
200 Ostream& os,
201 const minData& rhs
202)
203{
204 return os << rhs.data_;
205}
206
207
208inline Foam::Istream& Foam::operator>>
209(
210 Istream& is,
211 minData& rhs
212)
213{
214 return is >> rhs.data_;
215}
216
217
218// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
bool valid() const
True if all internal ids are non-negative.
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Default transformation behaviour.
For use with FaceCellWave. Transports minimum passive data.
Definition: minData.H:61
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition: minDataI.H:91
bool sameGeometry(const polyMesh &, const minData &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking)
Definition: minDataI.H:56
minData()
Default construct.
Definition: minDataI.H:33
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:103
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:124
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:69
bool equal(const minData &, TrackingData &td) const
Test for equality, with TrackingData.
Definition: minDataI.H:167
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
constexpr label labelMax
Definition: label.H:61
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)