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 | Copyright (C) 2012-2013 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  Class patchEdgeFaceRegion Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 {
62  // Private data
63 
64  //- region
65  label region_;
66 
67  // Private Member Functions
68 
69  //- Combine current with w2. Update region_ if w2 has smaller
70  // quantities and returns true.
71  template<class TrackingData>
72  inline bool update
73  (
74  const patchEdgeFaceRegion& w2,
75  const scalar tol,
76  TrackingData& td
77  );
78 
79 
80 public:
81 
82  // Constructors
83 
84  //- Construct null
85  inline patchEdgeFaceRegion();
86 
87  //- Construct from origin, distance
88  inline patchEdgeFaceRegion(const label);
89 
90 
91  // Member Functions
92 
93  // Access
94 
95  inline label region() const;
96 
97 
98  // Needed by meshWave
99 
100  //- Check whether origin has been changed at all or
101  // still contains original (invalid) value.
102  template<class TrackingData>
103  inline bool valid(TrackingData& td) const;
104 
105  //- Apply rotation matrix
106  template<class TrackingData>
107  inline void transform
108  (
109  const polyMesh& mesh,
110  const indirectPrimitivePatch& patch,
111  const tensor& rotTensor,
112  const scalar tol,
113  TrackingData& td
114  );
115 
116  //- Influence of face on edge
117  template<class TrackingData>
118  inline bool updateEdge
119  (
120  const polyMesh& mesh,
121  const indirectPrimitivePatch& patch,
122  const label edgeI,
123  const label faceI,
124  const patchEdgeFaceRegion& faceInfo,
125  const scalar tol,
126  TrackingData& td
127  );
128 
129  //- New information for edge (from e.g. coupled edge)
130  template<class TrackingData>
131  inline bool updateEdge
132  (
133  const polyMesh& mesh,
134  const indirectPrimitivePatch& patch,
135  const patchEdgeFaceRegion& edgeInfo,
136  const bool sameOrientation,
137  const scalar tol,
138  TrackingData& td
139  );
140 
141  //- Influence of edge on face.
142  template<class TrackingData>
143  inline bool updateFace
144  (
145  const polyMesh& mesh,
146  const indirectPrimitivePatch& patch,
147  const label faceI,
148  const label edgeI,
149  const patchEdgeFaceRegion& edgeInfo,
150  const scalar tol,
151  TrackingData& td
152  );
153 
154  //- Same (like operator==)
155  template<class TrackingData>
156  inline bool equal(const patchEdgeFaceRegion&, TrackingData&) const;
157 
158 
159  // Member Operators
160 
161  // Needed for List IO
162  inline bool operator==(const patchEdgeFaceRegion&) const;
163  inline bool operator!=(const patchEdgeFaceRegion&) const;
164 
165 
166  // IOstream Operators
167 
168  friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
170 };
171 
172 
173 //- Data associated with patchEdgeFaceRegion type are contiguous
174 template<>
176 {
177  return true;
178 }
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #include "patchEdgeFaceRegionI.H"
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::patchEdgeFaceRegion::operator==
bool operator==(const patchEdgeFaceRegion &) const
Definition: patchEdgeFaceRegionI.H:180
Foam::patchEdgeFaceRegion::region
label region() const
Definition: patchEdgeFaceRegionI.H:94
point.H
Foam::patchEdgeFaceRegion::region_
label region_
region
Definition: patchEdgeFaceRegion.H:64
tensor.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::patchEdgeFaceRegion::equal
bool equal(const patchEdgeFaceRegion &, TrackingData &) const
Same (like operator==)
Definition: patchEdgeFaceRegionI.H:168
Foam::patchEdgeFaceRegion::patchEdgeFaceRegion
patchEdgeFaceRegion()
Construct null.
Definition: patchEdgeFaceRegionI.H:76
Foam::label
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
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
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:121
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:109
Foam::patchEdgeFaceRegion::valid
bool valid(TrackingData &td) const
Check whether origin has been changed at all or.
Definition: patchEdgeFaceRegionI.H:101
scalar.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
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
Definition: patchEdgeFaceRegionI.H:189
patchEdgeFaceRegionI.H
label.H
Foam::contiguous< patchEdgeFaceRegion >
bool contiguous< patchEdgeFaceRegion >()
Data associated with patchEdgeFaceRegion type are contiguous.
Definition: patchEdgeFaceRegion.H:174
Foam::patchEdgeFaceRegion
Transport of region for use in PatchEdgeFaceWave.
Definition: patchEdgeFaceRegion.H:59
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:152
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::patchEdgeFaceRegion::update
bool update(const patchEdgeFaceRegion &w2, const scalar tol, TrackingData &td)
Combine current with w2. Update region_ if w2 has smaller.
Definition: patchEdgeFaceRegionI.H:34
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88