patchEdgeFaceInfo.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::patchEdgeFaceInfo
29
30Description
31
32SourceFiles
33 patchEdgeFaceInfoI.H
34 patchEdgeFaceInfo.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef patchEdgeFaceInfo_H
39#define patchEdgeFaceInfo_H
40
41#include "point.H"
42#include "label.H"
43#include "scalar.H"
44#include "tensor.H"
45#include "pTraits.H"
46#include "primitivePatch.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class polyPatch;
55class polyMesh;
56class patchEdgeFaceInfo;
57
58Istream& operator>>(Istream&, patchEdgeFaceInfo&);
59Ostream& operator<<(Ostream&, const patchEdgeFaceInfo&);
60
61/*---------------------------------------------------------------------------*\
62 Class patchEdgeFaceInfo Declaration
63\*---------------------------------------------------------------------------*/
66{
67 // Private Data
68
69 //- Position of nearest wall center
70 point origin_;
71
72 //- Normal distance (squared) from point to origin
73 scalar distSqr_;
74
75
76 // Private Member Functions
77
78 //- Evaluate distance to point.
79 // Update distSqr, origin from whomever is nearer pt.
80 // \return true if w2 is closer to point, false otherwise.
81 template<class TrackingData>
82 inline bool update
83 (
84 const point&,
85 const patchEdgeFaceInfo& w2,
86 const scalar tol,
87 TrackingData& td
88 );
89
90 //- Combine current with w2. Update distSqr, origin if w2 has smaller
91 // quantities and returns true.
92 template<class TrackingData>
93 inline bool update
94 (
95 const patchEdgeFaceInfo& w2,
96 const scalar tol,
97 TrackingData& td
98 );
99
100
101public:
102
103 // Constructors
104
105 //- Default construct
106 inline patchEdgeFaceInfo();
107
108 //- Construct from origin, distance squared
109 inline patchEdgeFaceInfo(const point& origin, const scalar distSqr);
110
111
112 // Member Functions
113
114 // Access
116 const point& origin() const
117 {
118 return origin_;
119 }
121 scalar distSqr() const
122 {
123 return distSqr_;
124 }
125
126
127 // Needed by MeshWave
128
129 //- Changed or contains original (invalid) value
130 template<class TrackingData>
131 inline bool valid(TrackingData& td) const;
132
133 //- Apply rotation matrix
134 template<class TrackingData>
135 inline void transform
136 (
137 const polyMesh& mesh,
138 const primitivePatch& patch,
139 const tensor& rotTensor,
140 const scalar tol,
141 TrackingData& td
142 );
143
144 //- Influence of face on edge
145 template<class TrackingData>
146 inline bool updateEdge
147 (
148 const polyMesh& mesh,
149 const primitivePatch& patch,
150 const label edgeI,
151 const label facei,
152 const patchEdgeFaceInfo& faceInfo,
153 const scalar tol,
154 TrackingData& td
155 );
156
157 //- New information for edge (from e.g. coupled edge)
158 template<class TrackingData>
159 inline bool updateEdge
160 (
161 const polyMesh& mesh,
162 const primitivePatch& patch,
163 const patchEdgeFaceInfo& edgeInfo,
164 const bool sameOrientation,
165 const scalar tol,
166 TrackingData& td
167 );
168
169 //- Influence of edge on face.
170 template<class TrackingData>
171 inline bool updateFace
172 (
173 const polyMesh& mesh,
174 const primitivePatch& patch,
175 const label facei,
176 const label edgeI,
177 const patchEdgeFaceInfo& edgeInfo,
178 const scalar tol,
179 TrackingData& td
180 );
181
182 //- Test for equality, with TrackingData
183 template<class TrackingData>
184 inline bool equal(const patchEdgeFaceInfo&, TrackingData& td) const;
185
186
187 // Member Operators
188
189 //- Test for equality
190 inline bool operator==(const patchEdgeFaceInfo&) const;
191
192 //- Test for inequality
193 inline bool operator!=(const patchEdgeFaceInfo&) const;
194
195
196 // IOstream Operators
200};
201
202
203// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
204
205//- Contiguous data for patchEdgeFaceInfo
206template<> struct is_contiguous<patchEdgeFaceInfo> : std::true_type {};
207
208//- Contiguous scalar data for patchEdgeFaceInfo
209template<> struct is_contiguous_scalar<patchEdgeFaceInfo> : std::true_type {};
210
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214} // End namespace Foam
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218#include "patchEdgeFaceInfoI.H"
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222#endif
223
224// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of faces which address into the list of points.
friend Istream & operator>>(Istream &, patchEdgeFaceInfo &)
const point & origin() const
bool updateEdge(const polyMesh &mesh, const primitivePatch &patch, const label edgeI, const label facei, const patchEdgeFaceInfo &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
friend Ostream & operator<<(Ostream &, const patchEdgeFaceInfo &)
bool operator==(const patchEdgeFaceInfo &) const
Test for equality.
patchEdgeFaceInfo()
Default construct.
bool valid(TrackingData &td) const
Changed or contains original (invalid) value.
bool operator!=(const patchEdgeFaceInfo &) const
Test for inequality.
bool equal(const patchEdgeFaceInfo &, TrackingData &td) const
Test for equality, with TrackingData.
void transform(const polyMesh &mesh, const primitivePatch &patch, const tensor &rotTensor, const scalar tol, TrackingData &td)
Apply rotation matrix.
bool updateFace(const polyMesh &mesh, const primitivePatch &patch, const label facei, const label edgeI, const patchEdgeFaceInfo &edgeInfo, const scalar tol, TrackingData &td)
Influence of edge on face.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
mesh update()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78