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