Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / meshTools / PointEdgeWave / pointEdgePoint.H
blobaa3dcb6d19a064aa802a9fc2e8c78e8c2d1a9e4d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::pointEdgePoint
28 Description
29     Holds information regarding nearest wall point. Used in pointEdgeWave.
30     (so not standard meshWave)
31     To be used in wall distance calculation.
33 SourceFiles
34     pointEdgePointI.H
35     pointEdgePoint.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef pointEdgePoint_H
40 #define pointEdgePoint_H
42 #include "point.H"
43 #include "label.H"
44 #include "scalar.H"
45 #include "tensor.H"
46 #include "pTraits.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 // Forward declaration of classes
55 class polyPatch;
56 class polyMesh;
58 /*---------------------------------------------------------------------------*\
59                            Class pointEdgePoint Declaration
60 \*---------------------------------------------------------------------------*/
62 class pointEdgePoint
64     // Private data
66         //- position of nearest wall center
67         point origin_;
69         //- normal distance (squared) from point to origin
70         scalar distSqr_;
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,
76         //  false otherwise.
77         inline bool update
78         (
79             const point&,
80             const pointEdgePoint& w2,
81             const scalar tol
82         );
84         //- Combine current with w2. Update distSqr, origin if w2 has smaller
85         //  quantities and returns true.
86         inline bool update
87         (
88             const pointEdgePoint& w2,
89             const scalar tol
90         );
92 public:
94     // Static data members
96         //- initial point far away.
97         static point greatPoint;
99     // Constructors
101         //- Construct null
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&);
111     // Member Functions
113         // Access
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)
128              const;
130             //- Convert origin to relative vector to leaving point
131             //  (= point coordinate)
132             inline void leaveDomain
133             (
134                 const polyPatch& patch,
135                 const label patchPointI,
136                 const point& pos
137             );
139             //- Convert relative origin to absolute by adding entering point
140             inline void enterDomain
141             (
142                 const polyPatch& patch,
143                 const label patchPointI,
144                 const point& pos
145             );
147             //- Apply rotation matrix to origin
148             inline void transform(const tensor& rotTensor);
150             //- Influence of edge on point
151             inline bool updatePoint
152             (
153                 const polyMesh& mesh,
154                 const label pointI,
155                 const label edgeI,
156                 const pointEdgePoint& edgeInfo,
157                 const scalar tol
158             );
160             //- Influence of different value on same point.
161             //  Merge new and old info.
162             inline bool updatePoint
163             (
164                 const polyMesh& mesh,
165                 const label pointI,
166                 const pointEdgePoint& newPointInfo,
167                 const scalar tol
168             );
170             //- Influence of different value on same point.
171             //  No information about current position whatsoever.
172             inline bool updatePoint
173             (
174                 const pointEdgePoint& newPointInfo,
175                 const scalar tol
176             );
178             //- Influence of point on edge.
179             inline bool updateEdge
180             (
181                 const polyMesh& mesh,
182                 const label edgeI,
183                 const label pointI,
184                 const pointEdgePoint& pointInfo,
185                 const scalar tol
186             );
189     // Member Operators
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //