WallLocationData.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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::WallLocationData
26 
27 Description
28  Holds information regarding nearest wall point. Used in wall distance
29  calculation.
30 
31 SourceFiles
32  WallLocationDataI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef WallLocationData_H
37 #define WallLocationData_H
38 
39 #include "point.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class transformer;
48 
49 // Forward declaration of friend functions and operators
50 template<class WallLocation, class Type>
51 class WallLocationData;
52 template<class WallLocation, class Type>
54 template<class WallLocation, class Type>
56 
57 /*---------------------------------------------------------------------------*\
58  Class WallLocationData Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class WallLocation, class Type>
62 class WallLocationData
63 :
64  public WallLocation
65 {
66  // Private Data
67 
68  //- Data at nearest wall center
69  Type data_;
70 
71 
72 protected:
73 
74  // Protected Member Functions
75 
76  //- Evaluate distance to point. Update distSqr, origin from whomever
77  // is nearer pt. Return true if w2 is closer to point, false
78  // otherwise.
79  template<class TrackingData>
80  inline bool update
81  (
82  const point& pt,
84  const scalar tol,
85  TrackingData& td
86  );
87 
88 
89 public:
90 
91  // Public Typedefs
92 
93  //- The type of the stored data
94  typedef Type dataType;
95 
96 
97  // Constructors
98 
99  //- Construct null
100  inline WallLocationData();
101 
102  //- Construct from data and other geometry
103  template<class ... Geometry>
104  inline WallLocationData(const Type& data, const Geometry& ... geometry);
105 
106 
107  // Member Functions
108 
109  // Access
110 
111  inline const Type& data() const;
112 
113  inline Type& data();
114 
115  template<class TrackingData>
116  inline const Type& data(TrackingData& td) const;
117 
118 
119  // Needed by FaceCellWave
120 
121  //- Transform across an interface
122  template<class TrackingData>
123  inline void transform
124  (
125  const transformer& transform,
126  TrackingData& td
127  );
128 
129 
130  // IOstream Operators
131 
132  friend Ostream& operator<< <WallLocation, Type>
133  (
134  Ostream&,
136  );
137  friend Istream& operator>> <WallLocation, Type>
138  (
139  Istream&,
141  );
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #include "WallLocationDataI.H"
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
#define w2
Definition: blockCreate.C:32
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Holds information regarding nearest wall point. Used in wall distance calculation.
Type dataType
The type of the stored data.
void transform(const transformer &transform, TrackingData &td)
Transform across an interface.
bool update(const point &pt, const WallLocationData< WallLocation, Type > &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
WallLocationData()
Construct null.
const Type & data() const
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)