FreeFOAM The Cross-Platform CFD Toolkit
wallPointData.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) 1991-2010 OpenCFD Ltd.
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::wallPointData
26 
27 Description
28  Holds information (coordinate and normal) regarding nearest wall point.
29 
30  Is like wallPoint but transfer extra (passive) data.
31  Used e.g. in wall distance calculation with wall reflection vectors.
32 
33 SourceFiles
34  wallPointDataI.H
35  wallPointData.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef wallPointData_H
40 #define wallPointData_H
41 
42 #include <meshTools/wallPoint.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 template<class Type> class wallPointData;
50 
51 // Forward declaration of friend functions and operators
52 
53 template<class Type> Istream& operator>>(Istream&, wallPointData<Type>&);
54 template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
55 
56 
57 /*---------------------------------------------------------------------------*\
58  Class wallPointData Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template <class Type>
63 :
64  public wallPoint
65 {
66  // Private data
67 
68  //- data at nearest wall center
69  Type data_;
70 
71 
72  // Private Member Functions
73 
74  //- Evaluate distance to point. Update distSqr, origin from whomever
75  // is nearer pt. Return true if w2 is closer to point,
76  // false otherwise.
77  inline bool update
78  (
79  const point&,
80  const wallPointData<Type>& w2,
81  const scalar tol
82  );
83 
84 
85 public:
86 
87  typedef Type dataType;
88 
89 
90  // Constructors
91 
92  //- Construct null
93  inline wallPointData();
94 
95  //- Construct from origin, normal, distance
96  inline wallPointData
97  (
98  const point& origin,
99  const Type& data,
100  const scalar distSqr
101  );
102 
103 
104  // Member Functions
105 
106  // Access
107 
108  inline const Type& data() const;
109  inline Type& data();
110 
111  // Needed by meshWave
112 
113  //- Influence of neighbouring face.
114  // Calls update(...) with cellCentre of cellI
115  inline bool updateCell
116  (
117  const polyMesh& mesh,
118  const label thisCellI,
119  const label neighbourFaceI,
120  const wallPointData<Type>& neighbourWallInfo,
121  const scalar tol
122  );
123 
124  //- Influence of neighbouring cell.
125  // Calls update(...) with faceCentre of faceI
126  inline bool updateFace
127  (
128  const polyMesh& mesh,
129  const label thisFaceI,
130  const label neighbourCellI,
131  const wallPointData<Type>& neighbourWallInfo,
132  const scalar tol
133  );
134 
135  //- Influence of different value on same face.
136  // Merge new and old info.
137  // Calls update(...) with faceCentre of faceI
138  inline bool updateFace
139  (
140  const polyMesh& mesh,
141  const label thisFaceI,
142  const wallPointData<Type>& neighbourWallInfo,
143  const scalar tol
144  );
145 
146  // Member Operators
147 
148  // IOstream Operators
149 
150  friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
151  friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #ifdef NoRepository
163 # include <meshTools/wallPointData.C>
164 #endif
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************ vim: set sw=4 sts=4 et: ************************ //