1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 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
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
27 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37 // Update this with w2 if w2 nearer to pt.
39 inline bool wallPointData<Type>::update
42 const wallPointData<Type>& w2,
46 scalar dist2 = magSqr(pt - w2.origin());
50 // current not yet set so use any value
52 origin() = w2.origin();
58 scalar diff = distSqr() - dist2;
62 // already nearer to pt
66 if ((diff < SMALL) || ((distSqr() > SMALL) && (diff/distSqr() < tol)))
68 // don't propagate small changes
73 // update with new values
75 origin() = w2.origin();
83 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
87 inline wallPointData<Type>::wallPointData()
94 // Construct from components
96 inline wallPointData<Type>::wallPointData
103 wallPoint(origin, distSqr),
108 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 template <class Type>
111 inline const Type& wallPointData<Type>::data() const
117 template <class Type>
118 inline Type& wallPointData<Type>::data()
124 // Update this with w2 if w2 nearer to pt.
125 template <class Type>
126 inline bool wallPointData<Type>::updateCell
128 const polyMesh& mesh,
129 const label thisCellI,
131 const wallPointData<Type>& neighbourWallInfo,
135 const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
139 cellCentres[thisCellI],
146 // Update this with w2 if w2 nearer to pt.
147 template <class Type>
148 inline bool wallPointData<Type>::updateFace
150 const polyMesh& mesh,
151 const label thisFaceI,
153 const wallPointData<Type>& neighbourWallInfo,
157 const vectorField& faceCentres = mesh.faceCentres();
161 faceCentres[thisFaceI],
168 // Update this with w2 if w2 nearer to pt.
169 template <class Type>
170 inline bool wallPointData<Type>::updateFace
172 const polyMesh& mesh,
173 const label thisFaceI,
174 const wallPointData<Type>& neighbourWallInfo,
178 const vectorField& faceCentres = mesh.faceCentres();
182 faceCentres[thisFaceI],
189 // ************************************************************************* //
191 } // End namespace Foam
193 // ************************************************************************* //