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