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