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/>.
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
52 template<class Type> class MeshWave;
54 /*---------------------------------------------------------------------------*\
55 Class patchWave Declaration
56 \*---------------------------------------------------------------------------*/
64 //- Current patch subset (stored as patchIDs)
65 labelHashSet patchIDs_;
67 //- Do accurate distance calculation for near-wall cells.
70 //- Number of cells/faces unset after MeshWave has finished
73 //- Distance at cell centres
74 scalarField distance_;
76 //- Distance at patch faces
77 FieldField<Field, scalar> patchDistance_;
80 // Private Member Functions
82 //- Set initial set of changed faces (= all faces of patches in
83 // patchIDs). Set changedFaces to labels of changed faces,
84 // changedInfo to face centres.
87 const labelHashSet& patchIDs,
88 labelList& changedFaces,
89 List<wallPoint>& changedInfo
92 //- Copy MeshWave cell values. Return number of illegal/unset
94 label getValues(const MeshWave<wallPoint>&);
101 //- Construct from mesh and patches to initialize to 0 and flag
102 // whether or not to correct wall.
103 // Calculate for all cells. correctWalls : correct wall (face&point)
104 // cells for correct distance, searching neighbours.
107 const polyMesh& mesh,
108 const labelHashSet& patchIDs,
109 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_;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //