1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Holds information regarding nearest wall point. Used in pointEdgeWave.
29 (so not standard meshWave)
30 To be used in wall distance calculation.
36 \*---------------------------------------------------------------------------*/
38 #ifndef pointEdgePoint_H
39 #define pointEdgePoint_H
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // Forward declaration of classes
56 /*---------------------------------------------------------------------------*\
57 Class pointEdgePoint Declaration
58 \*---------------------------------------------------------------------------*/
64 //- position of nearest wall center
67 //- normal distance (squared) from point to origin
71 // Private Member Functions
73 //- Evaluate distance to point. Update distSqr, origin from whomever
74 // is nearer pt. Return true if w2 is closer to point,
76 template<class TrackingData>
80 const pointEdgePoint& w2,
85 //- Combine current with w2. Update distSqr, origin if w2 has smaller
86 // quantities and returns true.
87 template<class TrackingData>
90 const pointEdgePoint& w2,
101 inline pointEdgePoint();
103 //- Construct from origin, distance
104 inline pointEdgePoint(const point&, const scalar);
106 //- Construct as copy
107 inline pointEdgePoint(const pointEdgePoint&);
114 inline const point& origin() const;
116 inline scalar distSqr() const;
119 // Needed by meshWave
121 //- Check whether origin has been changed at all or
122 // still contains original (invalid) value.
123 template<class TrackingData>
124 inline bool valid(TrackingData& td) const;
126 //- Check for identical geometrical data. Used for cyclics checking.
127 template<class TrackingData>
128 inline bool sameGeometry
130 const pointEdgePoint&,
135 //- Convert origin to relative vector to leaving point
136 // (= point coordinate)
137 template<class TrackingData>
138 inline void leaveDomain
140 const polyPatch& patch,
141 const label patchPointI,
146 //- Convert relative origin to absolute by adding entering point
147 template<class TrackingData>
148 inline void enterDomain
150 const polyPatch& patch,
151 const label patchPointI,
156 //- Apply rotation matrix to origin
157 template<class TrackingData>
158 inline void transform
160 const tensor& rotTensor,
164 //- Influence of edge on point
165 template<class TrackingData>
166 inline bool updatePoint
168 const polyMesh& mesh,
171 const pointEdgePoint& edgeInfo,
176 //- Influence of different value on same point.
177 // Merge new and old info.
178 template<class TrackingData>
179 inline bool updatePoint
181 const polyMesh& mesh,
183 const pointEdgePoint& newPointInfo,
188 //- Influence of different value on same point.
189 // No information about current position whatsoever.
190 template<class TrackingData>
191 inline bool updatePoint
193 const pointEdgePoint& newPointInfo,
198 //- Influence of point on edge.
199 template<class TrackingData>
200 inline bool updateEdge
202 const polyMesh& mesh,
205 const pointEdgePoint& pointInfo,
210 //- Same (like operator==)
211 template<class TrackingData>
212 inline bool equal(const pointEdgePoint&, TrackingData& td) const;
217 // Needed for List IO
218 inline bool operator==(const pointEdgePoint&) const;
219 inline bool operator!=(const pointEdgePoint&) const;
222 // IOstream Operators
224 friend Ostream& operator<<(Ostream&, const pointEdgePoint&);
225 friend Istream& operator>>(Istream&, pointEdgePoint&);
229 //- Data associated with pointEdgePoint type are contiguous
231 inline bool contiguous<pointEdgePoint>()
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 } // End namespace Foam
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 #include "pointEdgePointI.H"
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 // ************************************************************************* //