Forward compatibility: flex
[foam-extend-3.2.git] / src / meshTools / cellDist / wallPoint / wallPoint.H
blob437dbe773fc3c12d09c637b530bc1cfdeb2fa063
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::wallPoint
27 Description
28     Holds information regarding nearest wall point. Used in wall distance
29     calculation.
31 SourceFiles
32     wallPointI.H
33     wallPoint.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef wallPoint_H
38 #define wallPoint_H
40 #include "point.H"
41 #include "label.H"
42 #include "scalar.H"
43 #include "tensor.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 // Forward declaration of classes
51 class polyPatch;
52 class polyMesh;
53 class wallPoint;
55 // Forward declaration of friend functions and operators
56 Ostream& operator<<(Ostream&, const wallPoint&);
57 Istream& operator>>(Istream&, wallPoint&);
60 /*---------------------------------------------------------------------------*\
61                            Class wallPoint Declaration
62 \*---------------------------------------------------------------------------*/
64 class wallPoint
66     // Private data
68         //- position of nearest wall center
69         point origin_;
71         //- normal distance (squared) from cellcenter to origin
72         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
135             //  Used for cyclics checking
136             inline bool sameGeometry
137             (
138                 const polyMesh&,
139                 const wallPoint&,
140                 const scalar
141             ) const;
143             //- Convert any absolute coordinates into relative to (patch) face
144             //  centre
145             inline void leaveDomain
146             (
147                 const polyMesh&,
148                 const polyPatch&,
149                 const label patchFaceI,
150                 const point& faceCentre
151             );
153             //- Reverse of leaveDomain
154             inline void enterDomain
155             (
156                 const polyMesh&,
157                 const polyPatch&,
158                 const label patchFaceI,
159                 const point& faceCentre
160             );
162             //- Apply rotation matrix to any coordinates
163             inline void transform
164             (
165                 const polyMesh&,
166                 const tensor&
167             );
169             //- Influence of neighbouring face.
170             inline bool updateCell
171             (
172                 const polyMesh&,
173                 const label thisCellI,
174                 const label neighbourFaceI,
175                 const wallPoint& neighbourInfo,
176                 const scalar tol
177             );
179             //- Influence of neighbouring cell.
180             inline bool updateFace
181             (
182                 const polyMesh&,
183                 const label thisFaceI,
184                 const label neighbourCellI,
185                 const wallPoint& neighbourInfo,
186                 const scalar tol
187             );
189             //- Influence of different value on same face.
190             inline bool updateFace
191             (
192                 const polyMesh&,
193                 const label thisFaceI,
194                 const wallPoint& neighbourInfo,
195                 const scalar tol
196             );
199     // Member Operators
201         // Needed for List IO
202         inline bool operator==(const wallPoint&) const;
203         inline bool operator!=(const wallPoint&) const;
206     // IOstream Operators
208         friend Ostream& operator<<(Ostream&, const wallPoint&);
209         friend Istream& operator>>(Istream&, wallPoint&);
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 } // End namespace Foam
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 #include "wallPointI.H"
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 #endif
225 // ************************************************************************* //