wallFace.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::wallFace
26 
27 Description
28  Holds information regarding nearest wall point. Used in wall distance
29  calculation.
30 
31 SourceFiles
32  wallFaceI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef wallFace_H
37 #define wallFace_H
38 
39 #include "pointField.H"
40 #include "face.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class transformer;
49 
50 // Forward declaration of friend functions and operators
51 class wallFace;
52 Ostream& operator<<(Ostream&, const wallFace&);
53 Istream& operator>>(Istream&, wallFace&);
54 
55 /*---------------------------------------------------------------------------*\
56  Class wallFace Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class wallFace
60 {
61  // Private Data
62 
63  //- Face points
64  pointField points_;
65 
66  //- Normal distance (squared) from cell center to face
67  scalar distSqr_;
68 
69 
70 protected:
71 
72  // Protected 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, false
76  // otherwise.
77  template<class TrackingData>
78  inline bool update
79  (
80  const point& pt,
81  const wallFace& w2,
82  const scalar tol,
83  TrackingData& td
84  );
85 
86 
87 public:
88 
89  // Constructors
90 
91  //- Construct null
92  inline wallFace();
93 
94  //- Construct from face, distance
95  inline wallFace
96  (
97  const face& f,
98  const pointField& points,
99  const scalar distSqr
100  );
101 
102  //- Construct from face, distance
103  inline wallFace
104  (
105  const face& f,
106  const pointField& points,
107  const point& centre,
108  const scalar distSqr
109  );
110 
111 
112  // Member Functions
113 
114  // Access
115 
116  inline const pointField& points() const;
117 
118  inline pointField& points();
119 
120  inline scalar distSqr() const;
121 
122  inline scalar& distSqr();
123 
124  template<class TrackingData>
125  inline scalar dist(TrackingData& td) const;
126 
127 
128  // Needed by FaceCellWave
129 
130  //- Check whether the wallFace has been changed at all or still
131  // contains original (invalid) value.
132  template<class TrackingData>
133  inline bool valid(TrackingData& td) const;
134 
135  //- Check for identical geometrical data. Used for checking
136  // consistency across cyclics.
137  template<class TrackingData>
138  inline bool sameGeometry
139  (
140  const wallFace&,
141  const scalar,
142  TrackingData& td
143  ) const;
144 
145  //- Transform across an interface
146  template<class TrackingData>
147  inline void transform
148  (
149  const transformer& transform,
150  TrackingData& td
151  );
152 
153  //- Test equality
154  template<class TrackingData>
155  inline bool equal
156  (
157  const wallFace&,
158  TrackingData& td
159  ) const;
160 
161 
162  // Member Operators
163 
164  inline bool operator==(const wallFace&) const;
165  inline bool operator!=(const wallFace&) const;
166 
167 
168  // IOstream Operators
169 
170  inline friend Ostream& operator<<(Ostream&, const wallFace&);
171  inline friend Istream& operator>>(Istream&, wallFace&);
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #include "wallFaceI.H"
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
#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
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:76
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Holds information regarding nearest wall point. Used in wall distance calculation.
Definition: wallFace.H:59
wallFace()
Construct null.
Definition: wallFaceI.H:76
scalar dist(TrackingData &td) const
bool equal(const wallFace &, TrackingData &td) const
Test equality.
Definition: wallFaceI.H:178
void transform(const transformer &transform, TrackingData &td)
Transform across an interface.
Definition: wallFaceI.H:166
scalar distSqr() const
Definition: wallFaceI.H:122
friend Istream & operator>>(Istream &, wallFace &)
bool update(const point &pt, const wallFace &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
Definition: wallFaceI.H:34
bool valid(TrackingData &td) const
Check whether the wallFace has been changed at all or still.
Definition: wallFaceI.H:142
friend Ostream & operator<<(Ostream &, const wallFace &)
const pointField & points() const
Definition: wallFaceI.H:110
bool operator==(const wallFace &) const
Definition: wallFaceI.H:190
bool sameGeometry(const wallFace &, const scalar, TrackingData &td) const
Check for identical geometrical data. Used for checking.
Definition: wallFaceI.H:150
bool operator!=(const wallFace &) const
Definition: wallFaceI.H:199
Namespace for OpenFOAM.
Istream & operator>>(Istream &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)
labelList f(nPoints)