pointEdgeCollapse.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) 2012-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::pointEdgeCollapse
29
30Description
31 Determines length of string of edges walked to point.
32
33SourceFiles
34 pointEdgeCollapseI.H
35 pointEdgeCollapse.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef pointEdgeCollapse_H
40#define pointEdgeCollapse_H
41
42#include "point.H"
43#include "tensor.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class polyPatch;
52class polyMesh;
53class pointEdgeCollapse;
54
55Istream& operator>>(Istream&, pointEdgeCollapse&);
56Ostream& operator<<(Ostream&, const pointEdgeCollapse&);
57
58/*---------------------------------------------------------------------------*\
59 Class pointEdgeCollapse Declaration
60\*---------------------------------------------------------------------------*/
63{
64 // Private Data
65
66 //- Collapse location
67 point collapsePoint_;
68
69 //- Collapse string index
70 label collapseIndex_;
71
72 //- Priority of the collapse
73 label collapsePriority_;
74
75
76 // Private Member Functions
77
78 //- Evaluate distance to point.
79 template<class TrackingData>
80 inline bool update
81 (
82 const pointEdgeCollapse& w2,
83 const scalar tol,
84 TrackingData& td
85 );
86
87 //- Check for same coordinate
88 inline bool samePoint(const point& pt) const;
89
90public:
91
92 // Constructors
93
94 //- Default construct
95 inline pointEdgeCollapse();
96
97 //- Construct from components
99 (
100 const point& collapsePoint,
101 const label collapseIndex,
102 const label collapsePriority
103 );
104
105
106 // Member Functions
107
108 // Access
110 const point& collapsePoint() const
111 {
112 return collapsePoint_;
113 }
115 label collapseIndex() const
116 {
117 return collapseIndex_;
118 }
120 label collapsePriority() const
121 {
122 return collapsePriority_;
123 }
124
125
126 // Needed by MeshWave
127
128 //- Changed or contains original (invalid) value
129 template<class TrackingData>
130 inline bool valid(TrackingData& td) const;
131
132 //- Convert origin to relative vector to leaving point
133 // (= point coordinate)
134 template<class TrackingData>
135 inline void leaveDomain
136 (
137 const polyPatch& patch,
138 const label patchPointi,
139 const point& pos,
140 TrackingData& td
141 );
142
143 //- Convert relative origin to absolute by adding entering point
144 template<class TrackingData>
145 inline void enterDomain
146 (
147 const polyPatch& patch,
148 const label patchPointi,
149 const point& pos,
150 TrackingData& td
151 );
152
153 //- Apply rotation matrix to origin
154 template<class TrackingData>
155 inline void transform
156 (
157 const tensor& rotTensor,
158 TrackingData& td
159 );
160
161 //- Influence of edge on point
162 template<class TrackingData>
163 inline bool updatePoint
164 (
165 const polyMesh& mesh,
166 const label pointi,
167 const label edgeI,
168 const pointEdgeCollapse& edgeInfo,
169 const scalar tol,
170 TrackingData& td
171 );
172
173 //- Influence of different value on same point.
174 // Merge new and old info.
175 template<class TrackingData>
176 inline bool updatePoint
177 (
178 const polyMesh& mesh,
179 const label pointi,
180 const pointEdgeCollapse& newPointInfo,
181 const scalar tol,
182 TrackingData& td
183 );
184
185 //- Influence of different value on same point.
186 // No information about current position whatsoever.
187 template<class TrackingData>
188 inline bool updatePoint
189 (
190 const pointEdgeCollapse& newPointInfo,
191 const scalar tol,
192 TrackingData& td
193 );
194
195 //- Influence of point on edge.
196 template<class TrackingData>
197 inline bool updateEdge
198 (
199 const polyMesh& mesh,
200 const label edgeI,
201 const label pointi,
202 const pointEdgeCollapse& pointInfo,
203 const scalar tol,
204 TrackingData& td
205 );
206
207 //- Test for equality, with TrackingData
208 template<class TrackingData>
209 inline bool equal(const pointEdgeCollapse&, TrackingData&) const;
210
211
212 // Member Operators
213
214 //- Test for equality
215 inline bool operator==(const pointEdgeCollapse&) const;
216
217 //- Test for inequality
218 inline bool operator!=(const pointEdgeCollapse&) const;
219
220
221 // IOstream Operators
225};
226
227
228// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
229
230//- Contiguous data for pointEdgeCollapse
231template<> struct is_contiguous<pointEdgeCollapse> : std::true_type {};
232
233
234// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235
236} // End namespace Foam
237
238// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239
240#include "pointEdgeCollapseI.H"
241
242// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243
244#endif
245
246// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Determines length of string of edges walked to point.
bool updateEdge(const polyMesh &mesh, const label edgeI, const label pointi, const pointEdgeCollapse &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
pointEdgeCollapse()
Default construct.
bool equal(const pointEdgeCollapse &, TrackingData &) const
Test for equality, with TrackingData.
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.
bool operator==(const pointEdgeCollapse &) const
Test for equality.
bool operator!=(const pointEdgeCollapse &) const
Test for inequality.
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 updatePoint(const polyMesh &mesh, const label pointi, const label edgeI, const pointEdgeCollapse &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
friend Istream & operator>>(Istream &, pointEdgeCollapse &)
friend Ostream & operator<<(Ostream &, const pointEdgeCollapse &)
const point & collapsePoint() const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
mesh update()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78