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.
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"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward declaration of classes
57 template<class Type> class MeshWave;
59 /*---------------------------------------------------------------------------*\
60 Class patchDataWave Declaration
61 \*---------------------------------------------------------------------------*/
63 template<class TransferType>
71 typedef typename TransferType::dataType Type;
74 // Private Member Data
76 //- Current patch subset (stored as patchIDs)
77 labelHashSet patchIDs_;
79 //- Reference to initial extra data at patch faces
80 const UPtrList<Field<Type> >& initialPatchValuePtrs_;
82 //- Do accurate distance calculation for near-wall cells.
86 // After construction:
89 //- Number of cells/faces unset after MeshWave has finished
92 //- Distance at cell centres
93 scalarField distance_;
95 //- Distance at patch faces
96 FieldField<Field, scalar> patchDistance_;
98 //- Extra data at cell centres
99 Field<Type> cellData_;
101 //- Extra data at patch faces
102 FieldField<Field, Type> patchData_;
105 // Private Member Functions
107 //- Set initial set of changed faces
110 const labelHashSet& patchIDs,
115 //- Copy MeshWave values into *this
116 label getValues(const MeshWave<TransferType>&);
123 //- Construct from mesh, information on patches to initialize and flag
124 // whether or not to correct wall.
125 // Calculate for all cells. correctWalls : correct wall (face&point)
126 // cells for correct distance, searching neighbours.
129 const polyMesh& mesh,
130 const labelHashSet& patchIDs,
131 const UPtrList<Field<Type> >& initialPatchValuePtrs,
132 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 // ************************************************************************* //