patchEdgeFaceRegion.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) 2012-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::patchEdgeFaceRegion
26 
27 Description
28  Transport of region for use in PatchEdgeFaceWave.
29  Set element to -2 to denote blocked.
30 
31 SourceFiles
32  patchEdgeFaceRegionI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef patchEdgeFaceRegion_H
37 #define patchEdgeFaceRegion_H
38 
39 #include "point.H"
40 #include "label.H"
41 #include "scalar.H"
42 #include "tensor.H"
43 #include "indirectPrimitivePatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class polyPatch;
52 class polyMesh;
53 
54 
55 // Forward declaration of friend functions and operators
56 
57 class patchEdgeFaceRegion;
58 
59 Istream& operator>>(Istream&, patchEdgeFaceRegion&);
60 Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
61 
62 
63 /*---------------------------------------------------------------------------*\
64  Class patchEdgeFaceRegion Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 {
69  // Private Data
70 
71  //- region
72  label region_;
73 
74  // Private Member Functions
75 
76  //- Combine current with w2. Update region_ if w2 has smaller
77  // quantities and returns true.
78  template<class TrackingData>
79  inline bool update
80  (
81  const patchEdgeFaceRegion& w2,
82  const scalar tol,
83  TrackingData& td
84  );
85 
86 
87 public:
88 
89  // Constructors
90 
91  //- Construct null
92  inline patchEdgeFaceRegion();
93 
94  //- Construct from origin, distance
95  inline patchEdgeFaceRegion(const label);
96 
97 
98  // Member Functions
99 
100  // Access
101 
102  inline label region() const;
103 
104 
105  // Needed by meshWave
106 
107  //- Check whether origin has been changed at all or
108  // still contains original (invalid) value.
109  template<class TrackingData>
110  inline bool valid(TrackingData& td) const;
111 
112  //- Apply rotation matrix
113  template<class TrackingData>
114  inline void transform
115  (
116  const polyMesh& mesh,
117  const indirectPrimitivePatch& patch,
118  const tensor& rotTensor,
119  const scalar tol,
120  TrackingData& td
121  );
122 
123  //- Influence of face on edge
124  template<class TrackingData>
125  inline bool updateEdge
126  (
127  const polyMesh& mesh,
128  const indirectPrimitivePatch& patch,
129  const label edgei,
130  const label facei,
131  const patchEdgeFaceRegion& faceInfo,
132  const scalar tol,
133  TrackingData& td
134  );
135 
136  //- New information for edge (from e.g. coupled edge)
137  template<class TrackingData>
138  inline bool updateEdge
139  (
140  const polyMesh& mesh,
141  const indirectPrimitivePatch& patch,
142  const patchEdgeFaceRegion& edgeInfo,
143  const bool sameOrientation,
144  const scalar tol,
145  TrackingData& td
146  );
147 
148  //- Influence of edge on face.
149  template<class TrackingData>
150  inline bool updateFace
151  (
152  const polyMesh& mesh,
153  const indirectPrimitivePatch& patch,
154  const label facei,
155  const label edgei,
156  const patchEdgeFaceRegion& edgeInfo,
157  const scalar tol,
158  TrackingData& td
159  );
160 
161  //- Same (like operator==)
162  template<class TrackingData>
163  inline bool equal(const patchEdgeFaceRegion&, TrackingData&) const;
164 
165 
166  // Member Operators
167 
168  // Needed for List IO
169  inline bool operator==(const patchEdgeFaceRegion&) const;
170  inline bool operator!=(const patchEdgeFaceRegion&) const;
171 
172 
173  // IOstream Operators
174 
175  inline friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
176  inline friend Istream& operator>>(Istream&, patchEdgeFaceRegion&);
177 };
178 
179 
180 //- Data associated with patchEdgeFaceRegion type are contiguous
181 template<>
183 {
184  return true;
185 }
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #include "patchEdgeFaceRegionI.H"
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
#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
Transport of region for use in PatchEdgeFaceWave. Set element to -2 to denote blocked.
bool equal(const patchEdgeFaceRegion &, TrackingData &) const
Same (like operator==)
bool operator!=(const patchEdgeFaceRegion &) const
patchEdgeFaceRegion()
Construct null.
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
friend Ostream & operator<<(Ostream &, const patchEdgeFaceRegion &)
friend Istream & operator>>(Istream &, patchEdgeFaceRegion &)
void transform(const polyMesh &mesh, const indirectPrimitivePatch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
bool updateFace(const polyMesh &mesh, const indirectPrimitivePatch &patch, const label facei, const label edgei, const patchEdgeFaceRegion &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
bool updateEdge(const polyMesh &mesh, const indirectPrimitivePatch &patch, const label edgei, const label facei, const patchEdgeFaceRegion &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
bool operator==(const patchEdgeFaceRegion &) const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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< patchEdgeFaceRegion >()
Data associated with patchEdgeFaceRegion type are contiguous.