1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of classes
57 /*---------------------------------------------------------------------------*\
58 Class pointEdgePoint Declaration
59 \*---------------------------------------------------------------------------*/
65 //- position of nearest wall center
68 //- 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,
79 const pointEdgePoint& w2,
83 //- Combine current with w2. Update distSqr, origin if w2 has smaller
84 // quantities and returns true.
87 const pointEdgePoint& w2,
93 // Static data members
95 //- initial point far away.
96 static point greatPoint;
101 inline pointEdgePoint();
103 //- Construct from origin, distance
104 inline pointEdgePoint(const point& origin, const scalar distSqr);
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 inline bool valid() const;
125 //- Check for identical geometrical data. Used for cyclics checking.
126 inline bool sameGeometry(const pointEdgePoint&, const scalar tol)
129 //- Convert origin to relative vector to leaving point
130 // (= point coordinate)
131 inline void leaveDomain
133 const polyPatch& patch,
134 const label patchPointI,
138 //- Convert relative origin to absolute by adding entering point
139 inline void enterDomain
141 const polyPatch& patch,
142 const label patchPointI,
146 //- Apply rotation matrix to origin
147 inline void transform(const tensor& rotTensor);
149 //- Influence of edge on point
150 inline bool updatePoint
152 const polyMesh& mesh,
155 const pointEdgePoint& edgeInfo,
159 //- Influence of different value on same point.
160 // Merge new and old info.
161 inline bool updatePoint
163 const polyMesh& mesh,
165 const pointEdgePoint& newPointInfo,
169 //- Influence of different value on same point.
170 // No information about current position whatsoever.
171 inline bool updatePoint
173 const pointEdgePoint& newPointInfo,
177 //- Influence of point on edge.
178 inline bool updateEdge
180 const polyMesh& mesh,
183 const pointEdgePoint& pointInfo,
190 //Note: Used to determine whether to call update.
191 inline bool operator==(const pointEdgePoint&) const;
193 inline bool operator!=(const pointEdgePoint&) const;
196 // IOstream Operators
198 friend Ostream& operator<<(Ostream&, const pointEdgePoint&);
199 friend Istream& operator>>(Istream&, pointEdgePoint&);
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 } // End namespace Foam
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 #include "pointEdgePointI.H"
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 // ************************************************************************* //