pistonPointEdgeData.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) 2024 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::pistonPointEdgeData
26 
27 Description
28  Holds information regarding nearest wall point. Used in PointEdgeWave.
29  (so not standard FaceCellWave)
30  To be used in wall distance calculation.
31 
32 SourceFiles
33  pistonPointEdgeDataI.H
34  pistonPointEdgeData.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pistonPointEdgeData_H
39 #define pistonPointEdgeData_H
40 
41 #include "pointField.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyPatch;
50 class polyMesh;
51 class transformer;
52 
53 
54 // Forward declaration of friend functions and operators
55 
56 class pistonPointEdgeData;
57 
58 Istream& operator>>(Istream&, pistonPointEdgeData&);
59 Ostream& operator<<(Ostream&, const pistonPointEdgeData&);
60 
61 
62 /*---------------------------------------------------------------------------*\
63  Class pistonPointEdgeData Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 {
68  // Private Data
69 
70  //- Has this point or edge been visited
71  bool visited_;
72 
73  //- Is this point in the bowl
74  bool inBowl_;
75 
76 
77 public:
78 
79  //- Class used to pass data into container
80  class trackingData
81  {
82  public:
84  const vector axis_;
85  const scalar maxZ_;
86 
88  (
89  const pointField& points,
90  const vector& axis,
91  const scalar maxZ
92  )
93  :
94  points_(points),
95  axis_(axis),
96  maxZ_(maxZ)
97  {}
98  };
99 
100 
101 private:
102 
103  // Private Member Functions
104 
105  //- Update visited and inBowl
106  inline bool update(const point&, trackingData& td);
107 
108 
109 public:
110 
111  // Constructors
112 
113  //- Construct null
114  inline pistonPointEdgeData();
115 
116  //- Construct from inBowl
117  inline pistonPointEdgeData(const bool inBowl);
118 
119 
120  // Member Functions
121 
122  // Access
123 
124  inline bool inBowl() const;
125 
126 
127  // Needed by PointEdgeWave
128 
129  //- Check whether origin has been changed at all or
130  // still contains original (invalid) value.
131  inline bool valid(trackingData& td) const;
132 
133  //- Transform across an interface
134  inline void transform
135  (
136  const polyPatch& patch,
137  const label patchFacei,
138  const transformer& transform,
139  trackingData& td
140  );
141 
142  //- Influence of edge on point
143  inline bool updatePoint
144  (
145  const polyMesh& mesh,
146  const label pointi,
147  const label edgei,
148  const pistonPointEdgeData& edgeinfo,
149  const scalar tol,
150  trackingData& td
151  );
152 
153  //- Influence of different value on same point.
154  // Merge new and old info.
155  inline bool updatePoint
156  (
157  const polyMesh& mesh,
158  const label pointi,
159  const pistonPointEdgeData& newPointInfo,
160  const scalar tol,
161  trackingData& td
162  );
163 
164  //- Influence of point on edge.
165  inline bool updateEdge
166  (
167  const polyMesh& mesh,
168  const label edgei,
169  const label pointi,
170  const pistonPointEdgeData& pointInfo,
171  const scalar tol,
172  trackingData& td
173  );
174 
175  //- Equivalent to operator== with trackingData
176  inline bool equal
177  (
178  const pistonPointEdgeData&,
179  trackingData& td
180  ) const;
181 
182 
183  // Member Operators
184 
185  // Needed for List IO
186  inline bool operator==(const pistonPointEdgeData&) const;
187  inline bool operator!=(const pistonPointEdgeData&) const;
188 
189 
190  // IOstream Operators
191 
194 };
195 
196 
197 //- Data associated with pistonPointEdgeData type are contiguous
198 template<>
200 {
201  return true;
202 }
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #include "pistonPointEdgeDataI.H"
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
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
Class used to pass data into container.
trackingData(const pointField &points, const vector &axis, const scalar maxZ)
Holds information regarding nearest wall point. Used in PointEdgeWave. (so not standard FaceCellWave)...
friend Ostream & operator<<(Ostream &, const pistonPointEdgeData &)
bool valid(trackingData &td) const
Check whether origin has been changed at all or.
bool operator!=(const pistonPointEdgeData &) const
bool updateEdge(const polyMesh &mesh, const label edgei, const label pointi, const pistonPointEdgeData &pointInfo, const scalar tol, trackingData &td)
Influence of point on edge.
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgei, const pistonPointEdgeData &edgeinfo, const scalar tol, trackingData &td)
Influence of edge on point.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, trackingData &td)
Transform across an interface.
friend Istream & operator>>(Istream &, pistonPointEdgeData &)
bool equal(const pistonPointEdgeData &, trackingData &td) const
Equivalent to operator== with trackingData.
pistonPointEdgeData()
Construct null.
bool operator==(const pistonPointEdgeData &) const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
const pointField & points
Namespace for OpenFOAM.
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
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
bool contiguous< pistonPointEdgeData >()
Data associated with pistonPointEdgeData type are contiguous.