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
29 Takes a set of patches to start MeshWave from. After construction holds
30 distance at cells and distance at patches. Is e.g. used by wallDist to
31 construct volScalarField with correct distance to wall.
36 \*---------------------------------------------------------------------------*/
41 #include "cellDistFuncs.H"
42 #include "FieldField.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
53 template<class Type> class MeshWave;
55 /*---------------------------------------------------------------------------*\
56 Class patchWave Declaration
57 \*---------------------------------------------------------------------------*/
65 //- Current patch subset (stored as patchIDs)
66 labelHashSet patchIDs_;
68 //- Do accurate distance calculation for near-wall cells.
71 //- Number of cells/faces unset after MeshWave has finished
74 //- Distance at cell centres
75 scalarField distance_;
77 //- Distance at patch faces
78 FieldField<Field, scalar> patchDistance_;
81 // Private Member Functions
83 //- Set initial set of changed faces (= all faces of patches in
84 // patchIDs). Set changedFaces to labels of changed faces,
85 // changedInfo to face centres.
88 const labelHashSet& patchIDs,
89 labelList& changedFaces,
90 List<wallPoint>& changedInfo
93 //- Copy MeshWave cell values. Return number of illegal/unset
95 label getValues(const MeshWave<wallPoint>&);
102 //- Construct from mesh and patches to initialize to 0 and flag
103 // whether or not to correct wall.
104 // Calculate for all cells. correctWalls : correct wall (face&point)
105 // cells for correct distance, searching neighbours.
108 const polyMesh& mesh,
109 const labelHashSet& patchIDs,
110 bool correctWalls = true
115 virtual ~patchWave();
120 //- Correct for mesh geom/topo changes
121 virtual void correct();
129 const scalarField& distance() const
134 //- Non const access so we can 'transfer' contents for efficiency.
135 scalarField& distance()
140 const FieldField<Field, scalar>& patchDistance() const
142 return patchDistance_;
145 FieldField<Field, scalar>& patchDistance()
147 return patchDistance_;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //