initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / cellDist / wallPoint / wallPointData.H
blobb37f976fa3cbbe8a0d172abd1f7a72c14b2e1b6f
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::wallPointData
28 Description
29     Holds information (coordinate and normal) regarding nearest wall point.
31     Is like wallPoint but transfer extra (passive) data.
32     Used e.g. in wall distance calculation with wall reflection vectors.
34 SourceFiles
35     wallPointDataI.H
36     wallPointData.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef wallPointData_H
41 #define wallPointData_H
43 #include "wallPoint.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 template<class Type> class wallPointData;
52 // Forward declaration of friend functions and operators
54 template<class Type> Istream& operator>>(Istream&, wallPointData<Type>&);
55 template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
58 /*---------------------------------------------------------------------------*\
59                            Class wallPointData Declaration
60 \*---------------------------------------------------------------------------*/
62 template <class Type>
63 class wallPointData
65     public wallPoint
67     // Private data
69         //- data at nearest wall center
70         Type data_;
73     // Private Member Functions
75         //- Evaluate distance to point. Update distSqr, origin from whomever
76         //  is nearer pt. Return true if w2 is closer to point,
77         //  false otherwise.
78         inline bool update
79         (
80             const point&,
81             const wallPointData<Type>& w2,
82             const scalar tol
83         );
86 public:
88     typedef Type dataType;
91     // Constructors
93         //- Construct null
94         inline wallPointData();
96         //- Construct from origin, normal, distance
97         inline wallPointData
98         (
99             const point& origin,
100             const Type& data,
101             const scalar distSqr
102         );
105     // Member Functions
107         // Access
109             inline const Type& data() const;
110             inline Type& data();
112         // Needed by meshWave
114             //- Influence of neighbouring face.
115             //  Calls update(...) with cellCentre of cellI
116             inline bool updateCell
117             (
118                 const polyMesh& mesh,
119                 const label thisCellI,
120                 const label neighbourFaceI,
121                 const wallPointData<Type>& neighbourWallInfo,
122                 const scalar tol
123             );
125             //- Influence of neighbouring cell.
126             //  Calls update(...) with faceCentre of faceI
127             inline bool updateFace
128             (
129                 const polyMesh& mesh,
130                 const label thisFaceI,
131                 const label neighbourCellI,
132                 const wallPointData<Type>& neighbourWallInfo,
133                 const scalar tol
134             );
136             //- Influence of different value on same face.
137             //  Merge new and old info.
138             //  Calls update(...) with faceCentre of faceI
139             inline bool updateFace
140             (
141                 const polyMesh& mesh,
142                 const label thisFaceI,
143                 const wallPointData<Type>& neighbourWallInfo,
144                 const scalar tol
145             );
147     // Member Operators
149     // IOstream Operators
151         friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
152         friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #ifdef NoRepository
164 #   include "wallPointData.C"
165 #endif
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #include "wallPointDataI.H"
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #endif
175 // ************************************************************************* //