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/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 // Update this with w2 if w2 nearer to pt.
35 template <class TrackingData>
36 inline bool wallPointData<Type>::update
39 const wallPointData<Type>& w2,
44 scalar dist2 = magSqr(pt - w2.origin());
48 // current not yet set so use any value
50 origin() = w2.origin();
56 scalar diff = distSqr() - dist2;
60 // already nearer to pt
64 if ((diff < SMALL) || ((distSqr() > SMALL) && (diff/distSqr() < tol)))
66 // don't propagate small changes
71 // update with new values
73 origin() = w2.origin();
81 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
85 inline wallPointData<Type>::wallPointData()
92 // Construct from components
94 inline wallPointData<Type>::wallPointData
101 wallPoint(origin, distSqr),
106 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 template <class Type>
109 inline const Type& wallPointData<Type>::data() const
115 template <class Type>
116 inline Type& wallPointData<Type>::data()
122 // Update this with w2 if w2 nearer to pt.
123 template <class Type>
124 template <class TrackingData>
125 inline bool wallPointData<Type>::updateCell
127 const polyMesh& mesh,
128 const label thisCellI,
130 const wallPointData<Type>& neighbourWallInfo,
135 const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
139 cellCentres[thisCellI],
147 // Update this with w2 if w2 nearer to pt.
148 template <class Type>
149 template <class TrackingData>
150 inline bool wallPointData<Type>::updateFace
152 const polyMesh& mesh,
153 const label thisFaceI,
155 const wallPointData<Type>& neighbourWallInfo,
160 const vectorField& faceCentres = mesh.faceCentres();
164 faceCentres[thisFaceI],
172 // Update this with w2 if w2 nearer to pt.
173 template <class Type>
174 template <class TrackingData>
175 inline bool wallPointData<Type>::updateFace
177 const polyMesh& mesh,
178 const label thisFaceI,
179 const wallPointData<Type>& neighbourWallInfo,
184 const vectorField& faceCentres = mesh.faceCentres();
188 faceCentres[thisFaceI],
196 // ************************************************************************* //
198 } // End namespace Foam
200 // ************************************************************************* //