initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / autoMesh / autoHexMesh / autoHexMeshDriver / pointData / pointData.H
blobd27c62929d94e9ab167682fe5df98e6cb394cb1a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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::pointData
28 Description
29     Holds information regarding nearest wall point. Used in pointEdgeWave.
30     (so not standard meshWave)
32     To be used in wall distance calculation.
34 SourceFiles
35     pointDataI.H
36     pointData.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef pointData_H
41 #define pointData_H
43 #include "point.H"
44 #include "label.H"
45 #include "tensor.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 // Class forward declarations
54 class polyPatch;
55 class polyMesh;
57 /*---------------------------------------------------------------------------*\
58                            Class pointData Declaration
59 \*---------------------------------------------------------------------------*/
61 class pointData
63     // Private data
65         //- position of nearest wall center
66         point origin_;
68         //- normal distance (squared) from point to origin
69         scalar distSqr_;
71         //- additional information.
72         scalar s_;
74         //- additional information.
75         vector v_;
78     // Private Member Functions
80         //- Evaluate distance to point. Update distSqr, origin from whomever
81         //  is nearer pt. Return true if w2 is closer to point,
82         //  false otherwise.
83         inline bool update
84         (
85             const point&,
86             const pointData& w2,
87             const scalar tol
88         );
90         //- Combine current with w2. Update distSqr, origin if w2 has smaller
91         //  quantities and returns true.
92         inline bool update
93         (
94             const pointData& w2,
95             const scalar tol
96         );
98 public:
100     // Constructors
102         //- Construct null
103         inline pointData();
105         //- Construct from origin, distance
106         inline pointData
107         (
108             const point& origin,
109             const scalar distSqr,
110             const scalar s,
111             const vector& v
112         );
114         //- Construct as copy
115         inline pointData(const pointData&);
118     // Member Functions
120         // Access
122             inline const point& origin() const;
124             inline scalar distSqr() const;
126             inline scalar s() const;
128             inline const vector& v() const;
131         // Needed by meshWave
133             //- Check whether origin has been changed at all or
134             //  still contains original (invalid) value.
135             inline bool valid() const;
137             //- Check for identical geometrical data. Used for cyclics checking.
138             inline bool sameGeometry(const pointData&, const scalar tol)
139              const;
141             //- Convert origin to relative vector to leaving point
142             //  (= point coordinate)
143             inline void leaveDomain
144             (
145                 const polyPatch& patch,
146                 const label patchPointI,
147                 const point& pos
148             );
150             //- Convert relative origin to absolute by adding entering point
151             inline void enterDomain
152             (
153                 const polyPatch& patch,
154                 const label patchPointI,
155                 const point& pos
156             );
158             //- Apply rotation matrix to origin
159             inline void transform(const tensor& rotTensor);
161             //- Influence of edge on point
162             inline bool updatePoint
163             (
164                 const polyMesh& mesh,
165                 const label pointI,
166                 const label edgeI,
167                 const pointData& edgeInfo,
168                 const scalar tol
169             );
171             //- Influence of different value on same point.
172             //  Merge new and old info.
173             inline bool updatePoint
174             (
175                 const polyMesh& mesh,
176                 const label pointI,
177                 const pointData& newPointInfo,
178                 const scalar tol
179             );
181             //- Influence of different value on same point.
182             //  No information about current position whatsoever.
183             inline bool updatePoint
184             (
185                 const pointData& newPointInfo,
186                 const scalar tol
187             );
189             //- Influence of point on edge.
190             inline bool updateEdge
191             (
192                 const polyMesh& mesh,
193                 const label edgeI,
194                 const label pointI,
195                 const pointData& pointInfo,
196                 const scalar tol
197             );
200     // Member Operators
202         //Note: Used to determine whether to call update.
203         inline bool operator==(const pointData&) const;
205         inline bool operator!=(const pointData&) const;
208     // IOstream Operators
210         friend Ostream& operator<<(Ostream&, const pointData&);
211         friend Istream& operator>>(Istream&, pointData&);
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 } // End namespace Foam
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 #include "pointDataI.H"
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 #endif
227 // ************************************************************************* //