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 | Copyright (C) 2011 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 
51 /*---------------------------------------------------------------------------*\
52  Class pointEdgeStructuredWalk Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private data
58 
59  //- Starting location
60  point point0_;
61 
62  //- Previous point
64 
65  //- Sum of distance
66  scalar dist_;
67 
68  //- Passive data
69  vector data_;
70 
71  // Private Member Functions
72 
73  //- Evaluate distance to point.
74  template<class TrackingData>
75  inline bool update
76  (
77  const pointEdgeStructuredWalk& w2,
78  const scalar tol,
79  TrackingData& td
80  );
81 
82 public:
83 
84  // Constructors
85 
86  //- Construct null
87  inline pointEdgeStructuredWalk();
88 
89  //- Construct from components
91  (
92  const point&,
93  const point&,
94  const scalar,
95  const vector&
96  );
97 
98 
99  // Member Functions
100 
101  // Access
102 
103  inline bool inZone() const;
104 
105  inline scalar dist() const;
106 
107  inline const vector& data() const;
108 
109 
110  // Needed by meshWave
111 
112  //- Check whether origin has been changed at all or
113  // still contains original (invalid) value.
114  template<class TrackingData>
115  inline bool valid(TrackingData& td) const;
116 
117  //- Check for identical geometrical data. Used for cyclics checking.
118  template<class TrackingData>
119  inline bool sameGeometry
120  (
122  const scalar tol,
123  TrackingData& td
124  ) const;
125 
126  //- Convert origin to relative vector to leaving point
127  // (= point coordinate)
128  template<class TrackingData>
129  inline void leaveDomain
130  (
131  const polyPatch& patch,
132  const label patchPointI,
133  const point& pos,
134  TrackingData& td
135  );
136 
137  //- Convert relative origin to absolute by adding entering point
138  template<class TrackingData>
139  inline void enterDomain
140  (
141  const polyPatch& patch,
142  const label patchPointI,
143  const point& pos,
144  TrackingData& td
145  );
146 
147  //- Apply rotation matrix to origin
148  template<class TrackingData>
149  inline void transform
150  (
151  const tensor& rotTensor,
152  TrackingData& td
153  );
154 
155  //- Influence of edge on point
156  template<class TrackingData>
157  inline bool updatePoint
158  (
159  const polyMesh& mesh,
160  const label pointI,
161  const label edgeI,
162  const pointEdgeStructuredWalk& edgeInfo,
163  const scalar tol,
164  TrackingData& td
165  );
166 
167  //- Influence of different value on same point.
168  // Merge new and old info.
169  template<class TrackingData>
170  inline bool updatePoint
171  (
172  const polyMesh& mesh,
173  const label pointI,
174  const pointEdgeStructuredWalk& newPointInfo,
175  const scalar tol,
176  TrackingData& td
177  );
178 
179  //- Influence of different value on same point.
180  // No information about current position whatsoever.
181  template<class TrackingData>
182  inline bool updatePoint
183  (
184  const pointEdgeStructuredWalk& newPointInfo,
185  const scalar tol,
186  TrackingData& td
187  );
188 
189  //- Influence of point on edge.
190  template<class TrackingData>
191  inline bool updateEdge
192  (
193  const polyMesh& mesh,
194  const label edgeI,
195  const label pointI,
196  const pointEdgeStructuredWalk& pointInfo,
197  const scalar tol,
198  TrackingData& td
199  );
200 
201  //- Same (like operator==)
202  template<class TrackingData>
203  inline bool equal(const pointEdgeStructuredWalk&, TrackingData&)
204  const;
205 
206 
207  // Member Operators
208 
209  //Note: Used to determine whether to call update.
210  inline bool operator==(const pointEdgeStructuredWalk&) const;
211  inline bool operator!=(const pointEdgeStructuredWalk&) const;
212 
213 
214  // IOstream Operators
215 
218 };
219 
220 
221 //- Data associated with pointEdgeStructuredWalk type are contiguous
222 template<>
224 {
225  return true;
226 }
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::pointEdgeStructuredWalk::operator==
bool operator==(const pointEdgeStructuredWalk &) const
Definition: pointEdgeStructuredWalkI.H:281
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::pointEdgeStructuredWalk::data_
vector data_
Passive data.
Definition: pointEdgeStructuredWalk.H:68
Foam::pointEdgeStructuredWalk::dist
scalar dist() const
Definition: pointEdgeStructuredWalkI.H:98
pointEdgeStructuredWalkI.H
Foam::pointEdgeStructuredWalk
Determines length of string of edges walked to point.
Definition: pointEdgeStructuredWalk.H:54
point.H
Foam::pointEdgeStructuredWalk::transform
void transform(const tensor &rotTensor, TrackingData &td)
Apply rotation matrix to origin.
Definition: pointEdgeStructuredWalkI.H:161
Foam::pointEdgeStructuredWalk::leaveDomain
void leaveDomain(const polyPatch &patch, const label patchPointI, const point &pos, TrackingData &td)
Convert origin to relative vector to leaving point.
Definition: pointEdgeStructuredWalkI.H:148
Foam::pointEdgeStructuredWalk::dist_
scalar dist_
Sum of distance.
Definition: pointEdgeStructuredWalk.H:65
Foam::pointEdgeStructuredWalk::data
const vector & data() const
Definition: pointEdgeStructuredWalkI.H:104
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::pointEdgeStructuredWalk::operator!=
bool operator!=(const pointEdgeStructuredWalk &) const
Definition: pointEdgeStructuredWalkI.H:290
Foam::pointEdgeStructuredWalk::equal
bool equal(const pointEdgeStructuredWalk &, TrackingData &) const
Same (like operator==)
Definition: pointEdgeStructuredWalkI.H:269
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::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::pointEdgeStructuredWalk::valid
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: pointEdgeStructuredWalkI.H:111
Foam::pointEdgeStructuredWalk::updateEdge
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointI, const pointEdgeStructuredWalk &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
Definition: pointEdgeStructuredWalkI.H:247
Foam::pointEdgeStructuredWalk::enterDomain
void enterDomain(const polyPatch &patch, const label patchPointI, const point &pos, TrackingData &td)
Convert relative origin to absolute by adding entering point.
Definition: pointEdgeStructuredWalkI.H:174
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointEdgeStructuredWalk::updatePoint
bool updatePoint(const polyMesh &mesh, const label pointI, const label edgeI, const pointEdgeStructuredWalk &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
Definition: pointEdgeStructuredWalkI.H:189
Foam::pointEdgeStructuredWalk::point0_
point point0_
Starting location.
Definition: pointEdgeStructuredWalk.H:59
Foam::pointEdgeStructuredWalk::previousPoint_
point previousPoint_
Previous point.
Definition: pointEdgeStructuredWalk.H:62
Foam::pointEdgeStructuredWalk::inZone
bool inZone() const
Definition: pointEdgeStructuredWalkI.H:86
Foam::Vector< scalar >
Foam::pointEdgeStructuredWalk::update
bool update(const pointEdgeStructuredWalk &w2, const scalar tol, TrackingData &td)
Evaluate distance to point.
Definition: pointEdgeStructuredWalkI.H:34
Foam::pointEdgeStructuredWalk::pointEdgeStructuredWalk
pointEdgeStructuredWalk()
Construct null.
Definition: pointEdgeStructuredWalkI.H:59
Foam::pointEdgeStructuredWalk::operator<<
friend Ostream & operator<<(Ostream &, const pointEdgeStructuredWalk &)
Foam::pointEdgeStructuredWalk::operator>>
friend Istream & operator>>(Istream &, pointEdgeStructuredWalk &)
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::pointEdgeStructuredWalk::sameGeometry
bool sameGeometry(const pointEdgeStructuredWalk &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
Definition: pointEdgeStructuredWalkI.H:120
Foam::contiguous< pointEdgeStructuredWalk >
bool contiguous< pointEdgeStructuredWalk >()
Data associated with pointEdgeStructuredWalk type are contiguous.
Definition: pointEdgeStructuredWalk.H:222
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190