patchEdgeFaceRegion.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::patchEdgeFaceRegion
29 
30 Description
31  Transport of region for use in PatchEdgeFaceWave.
32 
33  Set element to -2 to denote blocked.
34 
35 SourceFiles
36  patchEdgeFaceRegionI.H
37  patchEdgeFaceRegion.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef patchEdgeFaceRegion_H
42 #define patchEdgeFaceRegion_H
43 
44 #include "point.H"
45 #include "label.H"
46 #include "scalar.H"
47 #include "tensor.H"
48 #include "indirectPrimitivePatch.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward Declarations
56 class polyPatch;
57 class polyMesh;
58 class patchEdgeFaceRegion;
59 
60 Istream& operator>>(Istream&, patchEdgeFaceRegion&);
61 Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class patchEdgeFaceRegion Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 {
70  // Private Data
71 
72  //- The region
73  label region_;
74 
75 
76  // Private Member Functions
77 
78  //- Combine current with w2.
79  // Update region_ if w2 has smaller quantities and return 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  //- Default construct
94  inline patchEdgeFaceRegion();
95 
96  //- Construct from region
97  inline patchEdgeFaceRegion(const label regioni);
98 
99 
100  // Member Functions
101 
102  // Access
103 
104  label region() const
105  {
106  return region_;
107  }
108 
109 
110  // Needed by MeshWave
111 
112  //- Changed or contains original (invalid) value
113  template<class TrackingData>
114  inline bool valid(TrackingData& td) const;
115 
116  //- Apply rotation matrix
117  template<class TrackingData>
118  inline void transform
119  (
120  const polyMesh& mesh,
122  const tensor& rotTensor,
123  const scalar tol,
124  TrackingData& td
125  );
126 
127  //- Influence of face on edge
128  template<class TrackingData>
129  inline bool updateEdge
130  (
131  const polyMesh& mesh,
133  const label edgeI,
134  const label facei,
135  const patchEdgeFaceRegion& faceInfo,
136  const scalar tol,
137  TrackingData& td
138  );
139 
140  //- New information for edge (from e.g. coupled edge)
141  template<class TrackingData>
142  inline bool updateEdge
143  (
144  const polyMesh& mesh,
146  const patchEdgeFaceRegion& edgeInfo,
147  const bool sameOrientation,
148  const scalar tol,
149  TrackingData& td
150  );
151 
152  //- Influence of edge on face.
153  template<class TrackingData>
154  inline bool updateFace
155  (
156  const polyMesh& mesh,
158  const label facei,
159  const label edgeI,
160  const patchEdgeFaceRegion& edgeInfo,
161  const scalar tol,
162  TrackingData& td
163  );
164 
165  //- Test for equality, with TrackingData
166  template<class TrackingData>
167  inline bool equal(const patchEdgeFaceRegion&, TrackingData&) const;
168 
169 
170  // Member Operators
171 
172  //- Test for equality
173  inline bool operator==(const patchEdgeFaceRegion&) const;
174 
175  //- Test for inequality
176  inline bool operator!=(const patchEdgeFaceRegion&) const;
177 
178 
179  // IOstream Operators
180 
181  friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
187 
188 //- Contiguous data for patchEdgeFaceRegion
189 template<> struct is_contiguous<patchEdgeFaceRegion> : std::true_type {};
190 
191 //- Contiguous label data for patchEdgeFaceRegion
192 template<> struct is_contiguous_label<patchEdgeFaceRegion> : std::true_type {};
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #include "patchEdgeFaceRegionI.H"
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::patchEdgeFaceRegion::operator==
bool operator==(const patchEdgeFaceRegion &) const
Test for equality.
Definition: patchEdgeFaceRegionI.H:175
point.H
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::is_contiguous_label
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:83
Foam::patchEdgeFaceRegion::equal
bool equal(const patchEdgeFaceRegion &, TrackingData &) const
Test for equality, with TrackingData.
Definition: patchEdgeFaceRegionI.H:163
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::patchEdgeFaceRegion::patchEdgeFaceRegion
patchEdgeFaceRegion()
Default construct.
Definition: patchEdgeFaceRegionI.H:78
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::patchEdgeFaceRegion::transform
void transform(const polyMesh &mesh, const indirectPrimitivePatch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
Definition: patchEdgeFaceRegionI.H:104
Foam::patchEdgeFaceRegion::updateFace
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.
Definition: patchEdgeFaceRegionI.H:147
indirectPrimitivePatch.H
Foam::patchEdgeFaceRegion::valid
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: patchEdgeFaceRegionI.H:96
scalar.H
w2
#define w2
Definition: blockCreate.C:35
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchEdgeFaceRegion::operator<<
friend Ostream & operator<<(Ostream &, const patchEdgeFaceRegion &)
Foam::patchEdgeFaceRegion::operator>>
friend Istream & operator>>(Istream &, patchEdgeFaceRegion &)
Foam::patchEdgeFaceRegion::operator!=
bool operator!=(const patchEdgeFaceRegion &) const
Test for inequality.
Definition: patchEdgeFaceRegionI.H:184
patchEdgeFaceRegionI.H
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
label.H
Foam::patchEdgeFaceRegion
Transport of region for use in PatchEdgeFaceWave.
Definition: patchEdgeFaceRegion.H:67
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75
Foam::patchEdgeFaceRegion::updateEdge
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.
Definition: patchEdgeFaceRegionI.H:116
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79
Foam::patchEdgeFaceRegion::region
label region() const
Definition: patchEdgeFaceRegion.H:103