pointEdgeStructuredWalk.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) 2011-2022 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::pointEdgeStructuredWalk
26 
27 Description
28  Determines length of string of edges walked to point.
29 
30 SourceFiles
31  pointEdgeStructuredWalkI.H
32  pointEdgeStructuredWalk.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pointEdgeStructuredWalk_H
37 #define pointEdgeStructuredWalk_H
38 
39 #include "point.H"
40 #include "tensor.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class polyPatch;
49 class polyMesh;
50 class transformer;
51 
52 
53 // Forward declaration of friend functions and operators
54 
55 class pointEdgeStructuredWalk;
56 
57 Istream& operator>>(Istream&, pointEdgeStructuredWalk&);
58 Ostream& operator<<(Ostream&, const pointEdgeStructuredWalk&);
59 
60 
61 /*---------------------------------------------------------------------------*\
62  Class pointEdgeStructuredWalk Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 {
67  // Private Data
68 
69  //- Starting location
70  point point0_;
71 
72  //- Previous point
73  point previousPoint_;
74 
75  //- Sum of distance
76  scalar dist_;
77 
78  //- Passive data
79  vector data_;
80 
81  // Private Member Functions
82 
83  //- Evaluate distance to point.
84  template<class TrackingData>
85  inline bool update
86  (
88  const scalar tol,
89  TrackingData& td
90  );
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct null
97  inline pointEdgeStructuredWalk();
98 
99  //- Construct from components
101  (
102  const point&,
103  const point&,
104  const scalar,
105  const vector&
106  );
107 
108 
109  // Member Functions
110 
111  // Access
112 
113  inline bool inZone() const;
114 
115  inline scalar dist() const;
116 
117  inline const vector& data() const;
118 
119 
120  // Needed by meshWave
121 
122  //- Check whether origin has been changed at all or
123  // still contains original (invalid) value.
124  template<class TrackingData>
125  inline bool valid(TrackingData& td) const;
126 
127  //- Check for identical geometrical data. Used for cyclics checking.
128  template<class TrackingData>
129  inline bool sameGeometry
130  (
132  const scalar tol,
133  TrackingData& td
134  ) const;
135 
136  //- Transform across an interface
137  template<class TrackingData>
138  inline void transform
139  (
140  const polyPatch& patch,
141  const label patchFacei,
142  const transformer& transform,
143  TrackingData& td
144  );
145 
146  //- Influence of edge on point
147  template<class TrackingData>
148  inline bool updatePoint
149  (
150  const polyMesh& mesh,
151  const label pointi,
152  const label edgeI,
153  const pointEdgeStructuredWalk& edgeInfo,
154  const scalar tol,
155  TrackingData& td
156  );
157 
158  //- Influence of different value on same point.
159  // Merge new and old info.
160  template<class TrackingData>
161  inline bool updatePoint
162  (
163  const polyMesh& mesh,
164  const label pointi,
165  const pointEdgeStructuredWalk& newPointInfo,
166  const scalar tol,
167  TrackingData& td
168  );
169 
170  //- Influence of different value on same point.
171  // No information about current position whatsoever.
172  template<class TrackingData>
173  inline bool updatePoint
174  (
175  const pointEdgeStructuredWalk& newPointInfo,
176  const scalar tol,
177  TrackingData& td
178  );
179 
180  //- Influence of point on edge.
181  template<class TrackingData>
182  inline bool updateEdge
183  (
184  const polyMesh& mesh,
185  const label edgeI,
186  const label pointi,
187  const pointEdgeStructuredWalk& pointInfo,
188  const scalar tol,
189  TrackingData& td
190  );
191 
192  //- Same (like operator==)
193  template<class TrackingData>
194  inline bool equal(const pointEdgeStructuredWalk&, TrackingData&)
195  const;
196 
197 
198  // Member Operators
199 
200  // Note: Used to determine whether to call update.
201  inline bool operator==(const pointEdgeStructuredWalk&) const;
202  inline bool operator!=(const pointEdgeStructuredWalk&) const;
203 
204 
205  // IOstream Operators
206 
209 };
210 
211 
212 //- Data associated with pointEdgeStructuredWalk type are contiguous
213 template<>
215 {
216  return true;
217 }
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #endif
231 
232 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
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:57
Determines length of string of edges walked to point.
bool operator==(const pointEdgeStructuredWalk &) const
friend Ostream & operator<<(Ostream &, const pointEdgeStructuredWalk &)
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. Used for cyclics checking.
bool equal(const pointEdgeStructuredWalk &, TrackingData &) const
Same (like operator==)
bool operator!=(const pointEdgeStructuredWalk &) const
friend Istream & operator>>(Istream &, pointEdgeStructuredWalk &)
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgeStructuredWalk &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
bool contiguous< pointEdgeStructuredWalk >()
Data associated with pointEdgeStructuredWalk type are contiguous.
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
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)