patchEdgeFaceRegions.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) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 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::patchEdgeFaceRegions
29 
30 Description
31  Transport of regions for use in PatchEdgeFaceWave.
32 
33  Set element to -1 to denote blocked.
34 
35 SourceFiles
36  patchEdgeFaceRegionsI.H
37  patchEdgeFaceRegions.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef patchEdgeFaceRegions_H
42 #define patchEdgeFaceRegions_H
43 
44 #include "labelList.H"
45 #include "scalar.H"
46 #include "tensor.H"
47 #include "labelPair.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward Declarations
55 class polyMesh;
56 class patchEdgeFaceRegions;
57 Istream& operator>>(Istream&, patchEdgeFaceRegions&);
58 Ostream& operator<<(Ostream&, const patchEdgeFaceRegions&);
59 
60 /*---------------------------------------------------------------------------*\
61  Class patchEdgeFaceRegions Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66  // Private Data
67 
68  //- Region per point
69  labelList regions_;
70 
71 public:
72 
73  // Constructors
74 
75  //- Default construct
76  inline patchEdgeFaceRegions();
77 
78  //- Construct from regions
79  inline patchEdgeFaceRegions(const labelList& regions);
80 
81  //- Construct from regions (on edge)
82  inline patchEdgeFaceRegions(const labelPair& regions);
83 
84 
85  // Member Functions
86 
87  // Access
88 
89  const labelList& regions() const
90  {
91  return regions_;
92  }
94  {
95  return regions_;
96  }
97 
98 
99  // Needed by MeshWave
100 
101  //- Changed or contains original (invalid) value
102  template<class TrackingData>
103  inline bool valid(TrackingData& td) const;
104 
105  //- Apply rotation matrix
106  template<class Patch, class TrackingData>
107  inline void transform
108  (
109  const polyMesh& mesh,
110  const Patch& patch,
111  const tensor& rotTensor,
112  const scalar tol,
113  TrackingData& td
114  );
115 
116  //- Influence of face on edge
117  template<class Patch, class TrackingData>
118  inline bool updateEdge
119  (
120  const polyMesh& mesh,
121  const Patch& patch,
122  const label edgeI,
123  const label facei,
124  const patchEdgeFaceRegions& faceInfo,
125  const scalar tol,
126  TrackingData& td
127  );
128 
129  //- New information for edge (from e.g. coupled edge)
130  template<class Patch, class TrackingData>
131  inline bool updateEdge
132  (
133  const polyMesh& mesh,
134  const Patch& patch,
135  const patchEdgeFaceRegions& edgeInfo,
136  const bool sameOrientation,
137  const scalar tol,
138  TrackingData& td
139  );
140 
141  //- Influence of edge on face.
142  template<class Patch, class TrackingData>
143  inline bool updateFace
144  (
145  const polyMesh& mesh,
146  const Patch& patch,
147  const label facei,
148  const label edgeI,
149  const patchEdgeFaceRegions& edgeInfo,
150  const scalar tol,
151  TrackingData& td
152  );
153 
154  //- Test for equality, with TrackingData
155  template<class TrackingData>
156  inline bool equal(const patchEdgeFaceRegions&, TrackingData&) const;
157 
158 
159  // Member Operators
160 
161  //- Test for equality
162  inline bool operator==(const patchEdgeFaceRegions&) const;
163 
164  //- Test for inequality
165  inline bool operator!=(const patchEdgeFaceRegions&) const;
166 
167 
168  // IOstream Operators
169 
170  friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegions&);
171  friend Istream& operator>>(Istream&, patchEdgeFaceRegions&);
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #include "patchEdgeFaceRegionsI.H"
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::patchEdgeFaceRegions::regions
const labelList & regions() const
Definition: patchEdgeFaceRegions.H:88
patchEdgeFaceRegionsI.H
Foam::patchEdgeFaceRegions::updateFace
bool updateFace(const polyMesh &mesh, const Patch &patch, const label facei, const label edgeI, const patchEdgeFaceRegions &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
Definition: patchEdgeFaceRegionsI.H:185
Foam::patchEdgeFaceRegions::transform
void transform(const polyMesh &mesh, const Patch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
Definition: patchEdgeFaceRegionsI.H:69
Foam::patchEdgeFaceRegions::operator==
bool operator==(const patchEdgeFaceRegions &) const
Test for equality.
Definition: patchEdgeFaceRegionsI.H:262
Foam::patchEdgeFaceRegions::regions
labelList & regions()
Definition: patchEdgeFaceRegions.H:92
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::patchEdgeFaceRegions::operator!=
bool operator!=(const patchEdgeFaceRegions &) const
Test for inequality.
Definition: patchEdgeFaceRegionsI.H:271
Foam::patchEdgeFaceRegions::operator<<
friend Ostream & operator<<(Ostream &, const patchEdgeFaceRegions &)
Foam::patchEdgeFaceRegions::updateEdge
bool updateEdge(const polyMesh &mesh, const Patch &patch, const label edgeI, const label facei, const patchEdgeFaceRegions &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
Definition: patchEdgeFaceRegionsI.H:81
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::patchEdgeFaceRegions::valid
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
Definition: patchEdgeFaceRegionsI.H:61
labelList.H
Foam::patchEdgeFaceRegions
Transport of regions for use in PatchEdgeFaceWave.
Definition: patchEdgeFaceRegions.H:63
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::patchEdgeFaceRegions::equal
bool equal(const patchEdgeFaceRegions &, TrackingData &) const
Test for equality, with TrackingData.
Definition: patchEdgeFaceRegionsI.H:250
Foam::patchEdgeFaceRegions::operator>>
friend Istream & operator>>(Istream &, patchEdgeFaceRegions &)
scalar.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Pair< label >
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::List< label >
Foam::patchEdgeFaceRegions::patchEdgeFaceRegions
patchEdgeFaceRegions()
Default construct.
Definition: patchEdgeFaceRegionsI.H:33
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
labelPair.H