Forward compatibility: flex
[foam-extend-3.2.git] / src / meshTools / cellDist / wallPoint / wallPointData.H
blobaacf185a33c5cbde3325a48d38bff2f8a5ea0df0
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::wallPointData
27 Description
28     Holds information (coordinate and normal) regarding nearest wall point.
30     Is like wallPoint but transfer extra (passive) data.
31     Used e.g. in wall distance calculation with wall reflection vectors.
33 SourceFiles
34     wallPointDataI.H
35     wallPointData.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef wallPointData_H
40 #define wallPointData_H
42 #include "wallPoint.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 template<class Type> class wallPointData;
51 // Forward declaration of friend functions and operators
53 template<class Type> Istream& operator>>(Istream&, wallPointData<Type>&);
54 template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
57 /*---------------------------------------------------------------------------*\
58                            Class wallPointData Declaration
59 \*---------------------------------------------------------------------------*/
61 template <class Type>
62 class wallPointData
64     public wallPoint
66     // Private data
68         //- Data at nearest wall center
69         Type data_;
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 wallPointData<Type>& w2,
81             const scalar tol
82         );
85 public:
87     typedef Type dataType;
90     // Constructors
92         //- Construct null
93         inline wallPointData();
95         //- Construct from origin, normal, distance
96         inline wallPointData
97         (
98             const point& origin,
99             const Type& data,
100             const scalar distSqr
101         );
104     // Member Functions
106         // Access
108             inline const Type& data() const;
109             inline Type& data();
111         // Needed by meshWave
113             //- Influence of neighbouring face.
114             //  Calls update(...) with cellCentre of cellI
115             inline bool updateCell
116             (
117                 const polyMesh& mesh,
118                 const label thisCellI,
119                 const label neighbourFaceI,
120                 const wallPointData<Type>& neighbourWallInfo,
121                 const scalar tol
122             );
124             //- Influence of neighbouring cell.
125             //  Calls update(...) with faceCentre of faceI
126             inline bool updateFace
127             (
128                 const polyMesh& mesh,
129                 const label thisFaceI,
130                 const label neighbourCellI,
131                 const wallPointData<Type>& neighbourWallInfo,
132                 const scalar tol
133             );
135             //- Influence of different value on same face.
136             //  Merge new and old info.
137             //  Calls update(...) with faceCentre of faceI
138             inline bool updateFace
139             (
140                 const polyMesh& mesh,
141                 const label thisFaceI,
142                 const wallPointData<Type>& neighbourWallInfo,
143                 const scalar tol
144             );
146     // Member Operators
148     // IOstream Operators
150         friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
151         friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 #ifdef NoRepository
163 #   include "wallPointData.C"
164 #endif
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #include "wallPointDataI.H"
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #endif
174 // ************************************************************************* //