Loading...
Searching...
No Matches
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-2025 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/>.
27\*---------------------------------------------------------------------------*/
28
29#include "polyMesh.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
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;
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;
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;
160
161 return false;
162}
163
164
165template<class TrackingData>
166inline bool Foam::minData::equal
167(
168 const minData& rhs,
169 TrackingData& td
170) const
171{
172 return operator==(rhs);
173}
174
175
176template<class TrackingData>
178(
179 const polyMesh& mesh,
180 const point& pt,
181 const label i0,
182 const minData& f0,
183 const label i1,
184 const minData& f1,
185 const scalar weight,
186 const scalar tol,
187 TrackingData& td
188)
189{
190 if (f0.valid(td))
191 {
192 return updateFace(mesh, -1, f0, tol, td);
193 }
194 if (f1.valid(td))
195 {
196 return updateFace(mesh, -1, f1, tol, td);
197 }
198 else
199 {
200 return false;
201 }
202}
203
204
205// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
206
207inline bool Foam::minData::operator==
208(
210) const
211{
212 return data_ == rhs.data_;
213}
214
215
216inline bool Foam::minData::operator!=
217(
218 const minData& rhs
219) const
221 return !(*this == rhs);
222}
223
224
225// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
226
227inline Foam::Ostream& Foam::operator<<
228(
229 Ostream& os,
231)
232{
233 return os << rhs.data_;
234}
235
236
237inline Foam::Istream& Foam::operator>>
238(
239 Istream& is,
240 minData& rhs
241)
242{
243 return is >> rhs.data_;
244}
245
246
247// ************************************************************************* //
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:59
For use with FaceCellWave. Transports minimum passive data.
Definition minData.H:57
bool interpolate(const polyMesh &, const point &pt, const label i0, const minData &f0, const label i1, const minData &f1, const scalar weight, const scalar tol, TrackingData &td)
Interpolate between two values (lerp). Returns true if causes changes. Not sure if needs to be specia...
Definition minDataI.H:171
void transform(const polyMesh &, const tensor &, TrackingData &td)
Apply rotation matrix to any coordinates.
Definition minDataI.H:74
void enterDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Reverse of leaveDomain.
Definition minDataI.H:84
bool sameGeometry(const polyMesh &, const minData &, const scalar, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking).
Definition minDataI.H:49
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition minDataI.H:41
minData()
Default construct.
Definition minDataI.H:26
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:96
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:117
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:62
label data() const
Definition minData.H:85
bool equal(const minData &, TrackingData &td) const
Test for equality, with TrackingData.
Definition minDataI.H:160
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Tensor< scalar > tensor
Definition symmTensor.H:57
constexpr label labelMax
Definition label.H:55
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
vector point
Point is a vector.
Definition point.H:37
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)