1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 Takes a set of patches to start MeshWave from. After construction holds
29 distance at cells and distance at patches. Is e.g. used by wallDist to
30 construct volScalarField with correct distance to wall.
35 \*---------------------------------------------------------------------------*/
40 #include "cellDistFuncs.H"
41 #include "FieldField.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class patchWave Declaration
55 \*---------------------------------------------------------------------------*/
63 //- Current patch subset (stored as patchIDs)
64 labelHashSet patchIDs_;
66 //- Do accurate distance calculation for near-wall cells.
69 //- Number of cells/faces unset after MeshWave has finished
72 //- Distance at cell centres
73 scalarField distance_;
75 //- Distance at patch faces
76 FieldField<Field, scalar> patchDistance_;
79 // Private Member Functions
81 //- Set initial set of changed faces (= all faces of patches in
82 // patchIDs). Set changedFaces to labels of changed faces,
83 // changedInfo to face centres.
86 const labelHashSet& patchIDs,
87 labelList& changedFaces,
88 List<wallPoint>& changedInfo
91 //- Copy MeshWave cell values. Return number of illegal/unset
93 label getValues(const MeshWave<wallPoint>&);
100 //- Construct from mesh and patches to initialize to 0 and flag
101 // whether or not to correct wall.
102 // Calculate for all cells. correctWalls : correct wall (face&point)
103 // cells for correct distance, searching neighbours.
106 const polyMesh& mesh,
107 const labelHashSet& patchIDs,
108 bool correctWalls = true
112 virtual ~patchWave();
117 //- Correct for mesh geom/topo changes
118 virtual void correct();
126 const scalarField& distance() const
131 //- Non const access so we can 'transfer' contents for efficiency.
132 scalarField& distance()
137 const FieldField<Field, scalar>& patchDistance() const
139 return patchDistance_;
142 FieldField<Field, scalar>& patchDistance()
144 return patchDistance_;
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 // ************************************************************************* //