patchDataWave.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::patchDataWave
26 
27 Description
28  Takes a set of patches to start MeshWave from.
29 
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.
33 
34 See Also
35  The patchWave class.
36 
37 SourceFiles
38  patchDataWave.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef patchDataWave_H
43 #define patchDataWave_H
44 
45 #include "cellDistFuncs.H"
46 #include "FieldField.H"
47 #include "UPtrList.H"
48 #include "MeshWave.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward declaration of classes
56 class polyMesh;
57 class wallPoint;
58 
59 /*---------------------------------------------------------------------------*\
60  Class patchDataWave Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class TransferType>
64 class patchDataWave
65 :
66  public cellDistFuncs
67 {
68 
69 private:
70 
71  typedef typename TransferType::dataType Type;
72 
73 
74  // Private Member Data
75 
76  //- Current patch subset (stored as patchIDs)
78 
79  //- Reference to initial extra data at patch faces
81 
82  //- Do accurate distance calculation for near-wall cells.
83  bool correctWalls_;
84 
85  //
86  // After construction:
87  //
88 
89  //- Number of cells/faces unset after MeshWave has finished
90  label nUnset_;
91 
92  //- Distance at cell centres
94 
95  //- Distance at patch faces
97 
98  //- Extra data at cell centres
100 
101  //- Extra data at patch faces
103 
104 
105  // Private Member Functions
106 
107  //- Set initial set of changed faces
108  void setChangedFaces
109  (
110  const labelHashSet& patchIDs,
111  labelList&,
113  ) const;
114 
115  //- Copy MeshWave values into *this
117 
118 
119 public:
120 
121  // Constructors
122 
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.
128  (
129  const polyMesh& mesh,
130  const labelHashSet& patchIDs,
131  const UPtrList<Field<Type> >& initialPatchValuePtrs,
132  bool correctWalls = true
133  );
134 
135 
136  //- Destructor
137  virtual ~patchDataWave();
138 
139 
140  // Member Functions
141 
142  //- Correct for mesh geom/topo changes
143  virtual void correct();
144 
145 
146  const scalarField& distance() const
147  {
148  return distance_;
149  }
150 
151  //- Non const access so we can 'transfer' contents for efficiency.
153  {
154  return distance_;
155  }
156 
158  {
159  return patchDistance_;
160  }
161 
163  {
164  return patchDistance_;
165  }
166 
167  const Field<Type>& cellData() const
168  {
169  return cellData_;
170  }
171 
173  {
174  return cellData_;
175  }
176 
177  const FieldField<Field, Type>& patchData() const
178  {
179  return patchData_;
180  }
181 
183  {
184  return patchData_;
185  }
186 
187  label nUnset() const
188  {
189  return nUnset_;
190  }
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #ifdef NoRepository
201 # include "patchDataWave.C"
202 #endif
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
Foam::patchDataWave::patchData_
FieldField< Field, Type > patchData_
Extra data at patch faces.
Definition: patchDataWave.H:101
UPtrList.H
Foam::FieldField
Generic field type.
Definition: FieldField.H:51
FieldField.H
Foam::patchDataWave::setChangedFaces
void setChangedFaces(const labelHashSet &patchIDs, labelList &, List< TransferType > &) const
Set initial set of changed faces.
Definition: patchDataWave.C:33
Foam::patchDataWave
Takes a set of patches to start MeshWave from.
Definition: patchDataWave.H:63
cellDistFuncs.H
Foam::patchDataWave::distance
scalarField & distance()
Non const access so we can 'transfer' contents for efficiency.
Definition: patchDataWave.H:151
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::patchDataWave::cellData
Field< Type > & cellData()
Definition: patchDataWave.H:171
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
MeshWave.H
Foam::MeshWave
FaceCellWave plus data.
Definition: MeshWave.H:56
Foam::patchDataWave::patchDistance_
FieldField< Field, scalar > patchDistance_
Distance at patch faces.
Definition: patchDataWave.H:95
Foam::patchDataWave::~patchDataWave
virtual ~patchDataWave()
Destructor.
Definition: patchDataWave.C:196
Foam::patchDataWave::Type
TransferType::dataType Type
Definition: patchDataWave.H:70
Foam::patchDataWave::distance
const scalarField & distance() const
Definition: patchDataWave.H:145
Foam::UPtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:53
Foam::patchDataWave::correctWalls_
bool correctWalls_
Do accurate distance calculation for near-wall cells.
Definition: patchDataWave.H:82
Foam::patchDataWave::cellData
const Field< Type > & cellData() const
Definition: patchDataWave.H:166
Foam::patchDataWave::distance_
scalarField distance_
Distance at cell centres.
Definition: patchDataWave.H:92
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cellDistFuncs::mesh
const polyMesh & mesh() const
Access mesh.
Definition: cellDistFuncs.H:95
Foam::patchDataWave::patchIDs_
labelHashSet patchIDs_
Current patch subset (stored as patchIDs)
Definition: patchDataWave.H:76
Foam::patchDataWave::patchData
FieldField< Field, Type > & patchData()
Definition: patchDataWave.H:181
Foam::patchDataWave::patchData
const FieldField< Field, Type > & patchData() const
Definition: patchDataWave.H:176
Foam::cellDistFuncs
Collection of functions used in wall distance calculation.
Definition: cellDistFuncs.H:61
Foam::patchDataWave::patchDataWave
patchDataWave(const polyMesh &mesh, const labelHashSet &patchIDs, const UPtrList< Field< Type > > &initialPatchValuePtrs, bool correctWalls=true)
Construct from mesh, information on patches to initialize and flag.
Definition: patchDataWave.C:172
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::patchDataWave::correct
virtual void correct()
Correct for mesh geom/topo changes.
Definition: patchDataWave.C:204
Foam::patchDataWave::nUnset_
label nUnset_
Number of cells/faces unset after MeshWave has finished.
Definition: patchDataWave.H:89
Foam::patchDataWave::nUnset
label nUnset() const
Definition: patchDataWave.H:186
Foam::patchDataWave::getValues
label getValues(const MeshWave< TransferType > &)
Copy MeshWave values into *this.
Definition: patchDataWave.C:75
patchDataWave.C
Foam::patchDataWave::initialPatchValuePtrs_
const UPtrList< Field< Type > > & initialPatchValuePtrs_
Reference to initial extra data at patch faces.
Definition: patchDataWave.H:79
Foam::patchDataWave::patchDistance
const FieldField< Field, scalar > & patchDistance() const
Definition: patchDataWave.H:156
Foam::patchDataWave::patchDistance
FieldField< Field, scalar > & patchDistance()
Definition: patchDataWave.H:161
Foam::patchDataWave::cellData_
Field< Type > cellData_
Extra data at cell centres.
Definition: patchDataWave.H:98