pointEdgeLayerInfo.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) 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::pointEdgeLayerInfo
26 
27 Description
28  Class to be used with PointEdgeWave which enumerates layers of points
29 
30 SourceFiles
31  pointEdgeLayerInfoI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pointEdgeLayerInfo_H
36 #define pointEdgeLayerInfo_H
37 
38 #include "contiguous.H"
39 #include "label.H"
40 #include "scalar.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class polyPatch;
49 class polyMesh;
50 class transformer;
51 
52 // Forward declaration of friend functions and operators
53 class pointEdgeLayerInfo;
54 inline Ostream& operator<<(Ostream&, const pointEdgeLayerInfo&);
55 inline Istream& operator>>(Istream&, pointEdgeLayerInfo&);
56 
57 /*---------------------------------------------------------------------------*\
58  Class pointEdgeLayerInfo Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 {
63  // Private Data
64 
65  //- Layer index
66  label layer_;
67 
68 
69 public:
70 
71  // Constructors
72 
73  //- Construct null
74  inline pointEdgeLayerInfo();
75 
76  //- Construct given the point layer index
77  inline pointEdgeLayerInfo(const label pointLayer);
78 
79 
80  // Member Functions
81 
82  // Access
83 
84  //- Return the point layer index
85  inline label pointLayer() const;
86 
87  //- Return the edge layer index
88  inline label edgeLayer() const;
89 
90 
91  // Needed by PointEdgeWave
92 
93  //- Check whether info has been changed at all or
94  // still contains original (invalid) value
95  template<class TrackingData>
96  inline bool valid(TrackingData& td) const;
97 
98  //- Check for identical geometrical data. Used for cyclics checking.
99  template<class TrackingData>
100  inline bool sameGeometry
101  (
102  const pointEdgeLayerInfo&,
103  const scalar tol,
104  TrackingData& td
105  ) const;
106 
107  //- Transform across an interface
108  template<class TrackingData>
109  inline void transform
110  (
111  const polyPatch& patch,
112  const label patchPointi,
113  const transformer& transform,
114  TrackingData& td
115  );
116 
117  //- Influence of edge on point
118  template<class TrackingData>
119  inline bool updatePoint
120  (
121  const polyMesh& mesh,
122  const label pointi,
123  const label edgei,
124  const pointEdgeLayerInfo& edgeInfo,
125  const scalar tol,
126  TrackingData& td
127  );
128 
129  //- Influence of different value on same point.
130  // Merge new and old info.
131  template<class TrackingData>
132  inline bool updatePoint
133  (
134  const polyMesh& mesh,
135  const label pointi,
136  const pointEdgeLayerInfo& newPointInfo,
137  const scalar tol,
138  TrackingData& td
139  );
140 
141  //- Influence of different value on same point.
142  // No old information.
143  template<class TrackingData>
144  inline bool updatePoint
145  (
146  const pointEdgeLayerInfo& newPointInfo,
147  const scalar tol,
148  TrackingData& td
149  );
150 
151  //- Influence of point on edge
152  template<class TrackingData>
153  inline bool updateEdge
154  (
155  const polyMesh& mesh,
156  const label edgei,
157  const label pointi,
158  const pointEdgeLayerInfo& pointInfo,
159  const scalar tol,
160  TrackingData& td
161  );
162 
163  //- Same (like operator==)
164  template<class TrackingData>
165  inline bool equal
166  (
167  const pointEdgeLayerInfo&,
168  TrackingData& td
169  ) const;
170 
171 
172  // Member Operators
173 
174  inline bool operator==(const pointEdgeLayerInfo&) const;
175  inline bool operator!=(const pointEdgeLayerInfo&) const;
176 
177 
178  // IOstream Operators
179 
180  inline friend Ostream& operator<<(Ostream&, const pointEdgeLayerInfo&);
181  inline friend Istream& operator>>(Istream&, pointEdgeLayerInfo&);
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 template<>
188 inline bool contiguous<pointEdgeLayerInfo>()
189 {
190  return true;
191 }
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #include "pointEdgeLayerInfoI.H"
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
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 to be used with PointEdgeWave which enumerates layers of points.
bool updateEdge(const polyMesh &mesh, const label edgei, const label pointi, const pointEdgeLayerInfo &pointInfo, const scalar tol, TrackingData &td)
Influence of point on edge.
bool operator==(const pointEdgeLayerInfo &) const
bool updatePoint(const polyMesh &mesh, const label pointi, const label edgei, const pointEdgeLayerInfo &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on point.
bool sameGeometry(const pointEdgeLayerInfo &, const scalar tol, TrackingData &td) const
Check for identical geometrical data. Used for cyclics checking.
bool operator!=(const pointEdgeLayerInfo &) const
friend Istream & operator>>(Istream &, pointEdgeLayerInfo &)
bool valid(TrackingData &td) const
Check whether info has been changed at all or.
bool equal(const pointEdgeLayerInfo &, TrackingData &td) const
Same (like operator==)
friend Ostream & operator<<(Ostream &, const pointEdgeLayerInfo &)
pointEdgeLayerInfo()
Construct null.
label pointLayer() const
Return the point layer index.
label edgeLayer() const
Return the edge layer index.
void transform(const polyPatch &patch, const label patchPointi, const transformer &transform, TrackingData &td)
Transform across an interface.
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
Template function to specify if the data of a type are contiguous.
Namespace for OpenFOAM.
bool contiguous< pointEdgeLayerInfo >()
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)