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