LayerInfoData.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::LayerInfoData
26 
27 Description
28  Class to be used with FaceCellWave which enumerates layers of cells and
29  transports data through those layers
30 
31 SourceFiles
32  LayerInfoDataI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef LayerInfoData_H
37 #define LayerInfoData_H
38 
39 #include "layerInfo.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class polyPatch;
48 class polyMesh;
49 class transformer;
50 
51 // Forward declaration of friend functions and operators
52 template<class Type>
53 class LayerInfoData;
54 template<class Type>
56 template<class Type>
58 
59 /*---------------------------------------------------------------------------*\
60  Class LayerInfoData Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Type>
64 class LayerInfoData
65 :
66  public layerInfo
67 {
68  // Private Data
69 
70  //- Data
71  Type data_;
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Construct null
79  inline LayerInfoData();
80 
81  //- Construct given the face layer index and direction
82  inline LayerInfoData
83  (
84  const label faceLayer,
85  const label direction,
86  const Type& data
87  );
88 
89 
90  // Member Functions
91 
92  // Access
93 
94  //- Return the data
95  inline const Type& data() const;
96 
97 
98  // Needed by FaceCellWave
99 
100  //- Transform across an interface
101  template<class TrackingData>
102  inline void transform
103  (
104  const polyPatch& patch,
105  const label patchFacei,
106  const transformer& transform,
107  TrackingData& td
108  );
109 
110  //- Influence of neighbouring face
111  template<class TrackingData>
112  inline bool updateCell
113  (
114  const polyMesh&,
115  const label thisCelli,
116  const label nbrFacei,
117  const LayerInfoData<Type>& nbrInfo,
118  const scalar tol,
119  TrackingData& td
120  );
121 
122  //- Influence of neighbouring cell
123  template<class TrackingData>
124  inline bool updateFace
125  (
126  const polyMesh&,
127  const label thisFacei,
128  const label nbrCelli,
129  const LayerInfoData<Type>& nbrInfo,
130  const scalar tol,
131  TrackingData& td
132  );
133 
134  //- Influence of different value on same face
135  template<class TrackingData>
136  inline bool updateFace
137  (
138  const polyMesh&,
139  const label thisFacei,
140  const LayerInfoData<Type>& nbrInfo,
141  const scalar tol,
142  TrackingData& td
143  );
144 
145  //- Test equality
146  template<class TrackingData>
147  inline bool equal
148  (
149  const LayerInfoData<Type>&,
150  TrackingData& td
151  ) const;
152 
153 
154  // Member Operators
155 
156  inline bool operator==(const LayerInfoData<Type>&) const;
157  inline bool operator!=(const LayerInfoData<Type>&) const;
158 
159 
160  // IOstream Operators
161 
162  friend Ostream& operator<< <Type>
163  (
164  Ostream&,
165  const LayerInfoData<Type>&
166  );
167  friend Istream& operator>> <Type>
168  (
169  Istream&,
171  );
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #define DefineContiguousLayerInfoDataType(Type, nullArg) \
178  template<> \
179  inline bool contiguous<LayerInfoData<Type>>() \
180  { \
181  return true; \
182  }
183 
187 
188 #undef DefineContiguousLayerInfoDataType
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #include "LayerInfoDataI.H"
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
#define DefineContiguousLayerInfoDataType(Type, nullArg)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Class to be used with FaceCellWave which enumerates layers of cells and transports data through those...
Definition: LayerInfoData.H:66
bool operator==(const LayerInfoData< Type > &) const
bool updateCell(const polyMesh &, const label thisCelli, const label nbrFacei, const LayerInfoData< Type > &nbrInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
LayerInfoData()
Construct null.
bool updateFace(const polyMesh &, const label thisFacei, const label nbrCelli, const LayerInfoData< Type > &nbrInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
bool equal(const LayerInfoData< Type > &, TrackingData &td) const
Test equality.
void transform(const polyPatch &patch, const label patchFacei, const transformer &transform, TrackingData &td)
Transform across an interface.
bool operator!=(const LayerInfoData< Type > &) const
const Type & data() const
Return the data.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Class to be used with FaceCellWave which enumerates layers of cells.
Definition: layerInfo.H:60
label faceLayer() const
Return the face layer index.
Definition: layerInfoI.H:61
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)
uint8_t direction
Definition: direction.H:45