1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
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.
37 \*---------------------------------------------------------------------------*/
39 #ifndef wallPointData_H
40 #define wallPointData_H
42 #include "wallPoint.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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 \*---------------------------------------------------------------------------*/
68 //- data at nearest wall center
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,
77 template<class TrackingData>
81 const wallPointData<Type>& w2,
89 typedef Type dataType;
95 inline wallPointData();
97 //- Construct from origin, normal, distance
110 inline const Type& data() const;
113 // Needed by meshWave
115 //- Influence of neighbouring face.
116 // Calls update(...) with cellCentre of cellI
117 template<class TrackingData>
118 inline bool updateCell
120 const polyMesh& mesh,
121 const label thisCellI,
122 const label neighbourFaceI,
123 const wallPointData<Type>& neighbourWallInfo,
128 //- Influence of neighbouring cell.
129 // Calls update(...) with faceCentre of faceI
130 template<class TrackingData>
131 inline bool updateFace
133 const polyMesh& mesh,
134 const label thisFaceI,
135 const label neighbourCellI,
136 const wallPointData<Type>& neighbourWallInfo,
141 //- Influence of different value on same face.
142 // Merge new and old info.
143 // Calls update(...) with faceCentre of faceI
144 template<class TrackingData>
145 inline bool updateFace
147 const polyMesh& mesh,
148 const label thisFaceI,
149 const wallPointData<Type>& neighbourWallInfo,
156 // IOstream Operators
158 friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
159 friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
163 //- Data associated with wallPointData type are contiguous. List the usual
167 inline bool contiguous<wallPointData<bool> >()
169 return contiguous<wallPoint>();
172 inline bool contiguous<wallPointData<label> >()
174 return contiguous<wallPoint>();
177 inline bool contiguous<wallPointData<scalar> >()
179 return contiguous<wallPoint>();
182 inline bool contiguous<wallPointData<vector> >()
184 return contiguous<wallPoint>();
187 inline bool contiguous<wallPointData<sphericalTensor> >()
189 return contiguous<wallPoint>();
192 inline bool contiguous<wallPointData<symmTensor> >()
194 return contiguous<wallPoint>();
197 inline bool contiguous<wallPointData<tensor> >()
199 return contiguous<wallPoint>();
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 # include "wallPointData.C"
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 #include "wallPointDataI.H"
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 // ************************************************************************* //