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