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