Loading...
Searching...
No Matches
pointEdgeStructuredWalk.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019-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
27Class
28 Foam::pointEdgeStructuredWalk
29
30Description
31 Determines length of string of edges walked to point.
32
33SourceFiles
34 pointEdgeStructuredWalkI.H
35 pointEdgeStructuredWalk.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef pointEdgeStructuredWalk_H
40#define pointEdgeStructuredWalk_H
41
42#include "point.H"
43#include "tensor.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class polyPatch;
52class polyMesh;
54
58/*---------------------------------------------------------------------------*\
59 Class pointEdgeStructuredWalk Declaration
60\*---------------------------------------------------------------------------*/
61
63{
64 // Private Data
65
66 //- Starting location
67 point point0_;
68
69 //- Previous point
70 point previousPoint_;
71
72 //- Sum of distance
73 scalar dist_;
74
75 //- Passive data
76 vector data_;
77
78 //- Index of passive data (optional)
79 label index_;
80
81
82 // Private Member Functions
83
84 //- Evaluate distance to point.
85 template<class TrackingData>
86 inline bool update
87 (
89 const scalar tol,
90 TrackingData& td
91 );
92
93public:
94
95 // Constructors
96
97 //- Default construct
99
100 //- Construct from components
102 (
103 const point& point0,
104 const point& previousPoint,
105 const scalar dist,
106 const vector& data,
107 const label index = -1
108 );
109
110
111 // Member Functions
112
113 // Access
114
115 //- The distance information
116 scalar dist() const
117 {
118 return dist_;
119 }
120
121 //- Tracking data
122 const vector& data() const
123 {
124 return data_;
125 }
126
127 //- Index (if any) associated with data
128 label index() const
130 return index_;
131 }
132
133 //- True if starting point is valid (ie, not point::max)
134 inline bool inZone() const;
135
136
137 // Needed by MeshWave
138
139 //- Changed or contains original (invalid) value
140 template<class TrackingData>
141 inline bool valid(TrackingData& td) const;
142
143 //- Check for identical geometrical data (eg, cyclics checking)
144 template<class TrackingData>
145 inline bool sameGeometry
146 (
148 const scalar tol,
149 TrackingData& td
150 ) const;
151
152 //- Convert origin to relative vector to leaving point
153 // (= point coordinate)
154 template<class TrackingData>
155 inline void leaveDomain
156 (
157 const polyPatch& patch,
158 const label patchPointi,
159 const point& pos,
160 TrackingData& td
161 );
162
163 //- Convert relative origin to absolute by adding entering point
164 template<class TrackingData>
165 inline void enterDomain
166 (
167 const polyPatch& patch,
168 const label patchPointi,
169 const point& pos,
170 TrackingData& td
171 );
172
173 //- Apply rotation matrix to origin
174 template<class TrackingData>
175 inline void transform
176 (
177 const tensor& rotTensor,
178 TrackingData& td
179 );
180
181 //- Influence of edge on point
182 template<class TrackingData>
183 inline bool updatePoint
184 (
185 const polyMesh& mesh,
186 const label pointi,
187 const label edgeI,
188 const pointEdgeStructuredWalk& edgeInfo,
189 const scalar tol,
190 TrackingData& td
191 );
192
193 //- Influence of different value on same point.
194 // Merge new and old info.
195 template<class TrackingData>
196 inline bool updatePoint
197 (
198 const polyMesh& mesh,
199 const label pointi,
200 const pointEdgeStructuredWalk& newPointInfo,
201 const scalar tol,
202 TrackingData& td
203 );
204
205 //- Influence of different value on same point.
206 // No information about current position whatsoever.
207 template<class TrackingData>
208 inline bool updatePoint
209 (
210 const pointEdgeStructuredWalk& newPointInfo,
211 const scalar tol,
212 TrackingData& td
213 );
214
215 //- Influence of point on edge.
216 template<class TrackingData>
217 inline bool updateEdge
218 (
219 const polyMesh& mesh,
220 const label edgeI,
221 const label pointi,
222 const pointEdgeStructuredWalk& pointInfo,
223 const scalar tol,
224 TrackingData& td
225 );
226
227 //- Test for equality, with TrackingData
228 template<class TrackingData>
229 inline bool equal
230 (
232 TrackingData&
233 ) const;
234
235
236 // Member Operators
237
238 //- Test for equality
239 inline bool operator==(const pointEdgeStructuredWalk&) const;
240
241 //- Test for inequality
242 inline bool operator!=(const pointEdgeStructuredWalk&) const;
243
244
245 // IOstream Operators
246
249};
250
251
252// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
253
254//- Contiguous data for pointEdgeStructuredWalk
255template<> struct is_contiguous<pointEdgeStructuredWalk> : std::true_type {};
256
257
258// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259
260} // End namespace Foam
261
262// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263
265
266// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267
268#endif
269
270// ************************************************************************* //
#define w2
Definition blockCreate.C:28
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
Determines length of string of edges walked to point.
bool operator==(const pointEdgeStructuredWalk &) const
Test for equality.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeStructuredWalk &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
bool sameGeometry(const pointEdgeStructuredWalk &, const scalar tol, TrackingData &td) const
Check for identical geometrical data (eg, cyclics checking).
label index() const
Index (if any) associated with data.
bool equal(const pointEdgeStructuredWalk &, TrackingData &) const
Test for equality, with TrackingData.
bool operator!=(const pointEdgeStructuredWalk &) const
Test for inequality.
const vector & data() const
Tracking data.
friend Istream & operator>>(Istream &, pointEdgeStructuredWalk &)
void leaveDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
scalar dist() const
The distance information.
friend Ostream & operator<<(Ostream &, const pointEdgeStructuredWalk &)
bool inZone() const
True if starting point is valid (ie, not point::max).
void enterDomain(const polyPatch &patch, const label patchPointi, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgeStructuredWalk &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
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
mesh update()
dynamicFvMesh & mesh
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
Tensor< scalar > tensor
Definition symmTensor.H:57
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
Definition point.H:37
Vector< scalar > vector
Definition vector.H:57
A template class to specify that a data type can be considered as being contiguous in memory.
Definition contiguous.H:70