1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Holds information regarding nearest wall point. Used in pointEdgeWave.
30 (so not standard meshWave)
31 To be used in wall distance calculation.
37 \*---------------------------------------------------------------------------*/
39 #ifndef pointEdgePoint_H
40 #define pointEdgePoint_H
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward declaration of classes
58 /*---------------------------------------------------------------------------*\
59 Class pointEdgePoint Declaration
60 \*---------------------------------------------------------------------------*/
66 //- position of nearest wall center
69 //- normal distance (squared) from point to origin
72 // Private Member Functions
74 //- Evaluate distance to point. Update distSqr, origin from whomever
75 // is nearer pt. Return true if w2 is closer to point,
80 const pointEdgePoint& w2,
84 //- Combine current with w2. Update distSqr, origin if w2 has smaller
85 // quantities and returns true.
88 const pointEdgePoint& w2,
94 // Static data members
96 //- initial point far away.
97 static point greatPoint;
102 inline pointEdgePoint();
104 //- Construct from origin, distance
105 inline pointEdgePoint(const point& origin, const scalar distSqr);
107 //- Construct as copy
108 inline pointEdgePoint(const pointEdgePoint&);
115 inline const point& origin() const;
117 inline scalar distSqr() const;
120 // Needed by meshWave
122 //- Check whether origin has been changed at all or
123 // still contains original (invalid) value.
124 inline bool valid() const;
126 //- Check for identical geometrical data. Used for cyclics checking.
127 inline bool sameGeometry(const pointEdgePoint&, const scalar tol)
130 //- Convert origin to relative vector to leaving point
131 // (= point coordinate)
132 inline void leaveDomain
134 const polyPatch& patch,
135 const label patchPointI,
139 //- Convert relative origin to absolute by adding entering point
140 inline void enterDomain
142 const polyPatch& patch,
143 const label patchPointI,
147 //- Apply rotation matrix to origin
148 inline void transform(const tensor& rotTensor);
150 //- Influence of edge on point
151 inline bool updatePoint
153 const polyMesh& mesh,
156 const pointEdgePoint& edgeInfo,
160 //- Influence of different value on same point.
161 // Merge new and old info.
162 inline bool updatePoint
164 const polyMesh& mesh,
166 const pointEdgePoint& newPointInfo,
170 //- Influence of different value on same point.
171 // No information about current position whatsoever.
172 inline bool updatePoint
174 const pointEdgePoint& newPointInfo,
178 //- Influence of point on edge.
179 inline bool updateEdge
181 const polyMesh& mesh,
184 const pointEdgePoint& pointInfo,
191 //Note: Used to determine whether to call update.
192 inline bool operator==(const pointEdgePoint&) const;
194 inline bool operator!=(const pointEdgePoint&) const;
197 // IOstream Operators
199 friend Ostream& operator<<(Ostream&, const pointEdgePoint&);
200 friend Istream& operator>>(Istream&, pointEdgePoint&);
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #include "pointEdgePointI.H"
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 // ************************************************************************* //