initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / cellDist / wallPoint / wallPoint.H
blob82d6b385af96d0efe538574416ec70a3d41f579d
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::wallPoint
28 Description
29     Holds information regarding nearest wall point. Used in wall distance
30     calculation.
32 SourceFiles
33     wallPointI.H
34     wallPoint.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef wallPoint_H
39 #define wallPoint_H
41 #include "point.H"
42 #include "label.H"
43 #include "scalar.H"
44 #include "tensor.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 // Forward declaration of classes
52 class polyPatch;
53 class polyMesh;
54 class wallPoint;
56 // Forward declaration of friend functions and operators
57 Ostream& operator<<(Ostream&, const wallPoint&);
58 Istream& operator>>(Istream&, wallPoint&);
61 /*---------------------------------------------------------------------------*\
62                            Class wallPoint Declaration
63 \*---------------------------------------------------------------------------*/
65 class wallPoint
67     // Private data
69         //- position of nearest wall center
70         point origin_;
72         //- normal distance (squared) from cellcenter to origin
73         scalar distSqr_;
75     // Private Member Functions
77         //- Evaluate distance to point. Update distSqr, origin from whomever
78         //  is nearer pt. Return true if w2 is closer to point,
79         //  false otherwise.
80         inline bool update
81         (
82             const point&,
83             const wallPoint& w2,
84             const scalar tol
85         );
88 public:
90     // Static data members
92         //- initial point far away.
93         static point greatPoint;
96     // Constructors
98         //- Construct null
99         inline wallPoint();
101         //- Construct from origin, distance
102         inline wallPoint
103         (
104             const point& origin,
105             const scalar distSqr
106         );
108         //- Construct as copy
109         inline wallPoint
110         (
111             const wallPoint&
112         );
115     // Member Functions
117         // Access
119             inline const point& origin() const;
121             inline point& origin();
123             inline scalar distSqr() const;
125             inline scalar& distSqr();
128         // Needed by FaceCellWave
130             //- Check whether origin has been changed at all or
131             //  still contains original (invalid) value.
132             inline bool valid() const;
134             //- Check for identical geometrical data. Used for cyclics checking.
135             inline bool sameGeometry
136             (
137                 const polyMesh&,
138                 const wallPoint&,
139                 const scalar
140             ) const;
142             //- Convert any absolute coordinates into relative to (patch)face
143             //  centre
144             inline void leaveDomain
145             (
146                 const polyMesh&,
147                 const polyPatch&,
148                 const label patchFaceI,
149                 const point& faceCentre
150             );
152             //- Reverse of leaveDomain
153             inline void enterDomain
154             (
155                 const polyMesh&,
156                 const polyPatch&,
157                 const label patchFaceI,
158                 const point& faceCentre
159             );
161             //- Apply rotation matrix to any coordinates
162             inline void transform
163             (
164                 const polyMesh&,
165                 const tensor&
166             );
168             //- Influence of neighbouring face.
169             inline bool updateCell
170             (
171                 const polyMesh&,
172                 const label thisCellI,
173                 const label neighbourFaceI,
174                 const wallPoint& neighbourInfo,
175                 const scalar tol
176             );
178             //- Influence of neighbouring cell.
179             inline bool updateFace
180             (
181                 const polyMesh&,
182                 const label thisFaceI,
183                 const label neighbourCellI,
184                 const wallPoint& neighbourInfo,
185                 const scalar tol
186             );
188             //- Influence of different value on same face.
189             inline bool updateFace
190             (
191                 const polyMesh&,
192                 const label thisFaceI,
193                 const wallPoint& neighbourInfo,
194                 const scalar tol
195             );
198     // Member Operators
200         // Needed for List IO
201         inline bool operator==(const wallPoint&) const;
202         inline bool operator!=(const wallPoint&) const;
205     // IOstream Operators
207         friend Ostream& operator<<(Ostream&, const wallPoint&);
208         friend Istream& operator>>(Istream&, wallPoint&);
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 } // End namespace Foam
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 #include "wallPointI.H"
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 #endif
224 // ************************************************************************* //