1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
26 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 // Update this with w2 if w2 nearer to pt.
38 inline bool wallPointData<Type>::update
41 const wallPointData<Type>& w2,
45 scalar dist2 = magSqr(pt - w2.origin());
49 // current not yet set so use any value
51 origin() = w2.origin();
57 scalar diff = distSqr() - dist2;
61 // already nearer to pt
65 if ((diff < SMALL) || ((distSqr() > SMALL) && (diff/distSqr() < tol)))
67 // don't propagate small changes
72 // update with new values
74 origin() = w2.origin();
82 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
86 inline wallPointData<Type>::wallPointData()
93 // Construct from components
95 inline wallPointData<Type>::wallPointData
102 wallPoint(origin, distSqr),
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
109 template <class Type>
110 inline const Type& wallPointData<Type>::data() const
116 template <class Type>
117 inline Type& wallPointData<Type>::data()
123 // Update this with w2 if w2 nearer to pt.
124 template <class Type>
125 inline bool wallPointData<Type>::updateCell
127 const polyMesh& mesh,
128 const label thisCellI,
130 const wallPointData<Type>& neighbourWallInfo,
134 const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
138 cellCentres[thisCellI],
145 // Update this with w2 if w2 nearer to pt.
146 template <class Type>
147 inline bool wallPointData<Type>::updateFace
149 const polyMesh& mesh,
150 const label thisFaceI,
152 const wallPointData<Type>& neighbourWallInfo,
156 const vectorField& faceCentres = mesh.faceCentres();
160 faceCentres[thisFaceI],
167 // Update this with w2 if w2 nearer to pt.
168 template <class Type>
169 inline bool wallPointData<Type>::updateFace
171 const polyMesh& mesh,
172 const label thisFaceI,
173 const wallPointData<Type>& neighbourWallInfo,
177 const vectorField& faceCentres = mesh.faceCentres();
181 faceCentres[thisFaceI],
188 // ************************************************************************* //
190 } // End namespace Foam
192 // ************************************************************************* //