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.
30 Holds after construction distance at cells and distance at patches
31 (like patchWave), but also additional transported data.
32 It is used, for example, in the y+ calculation.
40 \*---------------------------------------------------------------------------*/
42 #ifndef patchDataWave_H
43 #define patchDataWave_H
45 #include "cellDistFuncs.H"
46 #include "FieldField.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 //template<class Type, class TrackingData> class MeshWave;
60 /*---------------------------------------------------------------------------*\
61 Class patchDataWave Declaration
62 \*---------------------------------------------------------------------------*/
64 template<class TransferType>
72 typedef typename TransferType::dataType Type;
75 // Private Member Data
77 //- Current patch subset (stored as patchIDs)
78 labelHashSet patchIDs_;
80 //- Reference to initial extra data at patch faces
81 const UPtrList<Field<Type> >& initialPatchValuePtrs_;
83 //- Do accurate distance calculation for near-wall cells.
87 // After construction:
90 //- Number of cells/faces unset after MeshWave has finished
93 //- Distance at cell centres
94 scalarField distance_;
96 //- Distance at patch faces
97 FieldField<Field, scalar> patchDistance_;
99 //- Extra data at cell centres
100 Field<Type> cellData_;
102 //- Extra data at patch faces
103 FieldField<Field, Type> patchData_;
106 // Private Member Functions
108 //- Set initial set of changed faces
111 const labelHashSet& patchIDs,
116 //- Copy MeshWave values into *this
117 label getValues(const MeshWave<TransferType>&);
124 //- Construct from mesh, information on patches to initialize and flag
125 // whether or not to correct wall.
126 // Calculate for all cells. correctWalls : correct wall (face&point)
127 // cells for correct distance, searching neighbours.
130 const polyMesh& mesh,
131 const labelHashSet& patchIDs,
132 const UPtrList<Field<Type> >& initialPatchValuePtrs,
133 bool correctWalls = true
138 virtual ~patchDataWave();
143 //- Correct for mesh geom/topo changes
144 virtual void correct();
147 const scalarField& distance() const
152 //- Non const access so we can 'transfer' contents for efficiency.
153 scalarField& distance()
158 const FieldField<Field, scalar>& patchDistance() const
160 return patchDistance_;
163 FieldField<Field, scalar>& patchDistance()
165 return patchDistance_;
168 const Field<Type>& cellData() const
173 Field<Type>& cellData()
178 const FieldField<Field, Type>& patchData() const
183 FieldField<Field, Type>& patchData()
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 # include "patchDataWave.C"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //