Loading...
Searching...
No Matches
wallPointAddressing.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) 2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::wallPointAddressing
28
29Description
30 Holds information (coordinate and origin) regarding nearest wall point.
31
32 Is like wallPoint but transfer extra (passive) data.
33 Used e.g. in wall distance calculation with wall reflection vectors.
34
35SourceFiles
36 wallPointAddressingI.H
37 wallPointAddressing.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef wallPointAddressing_H
42#define wallPointAddressing_H
43
44#include "wallPoint.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
54
57
59/*---------------------------------------------------------------------------*\
60 Class wallPointAddressing Declaration
61\*---------------------------------------------------------------------------*/
62
64:
65 public wallPoint
66{
67 // Private Data
68
69 //- Data at nearest wall center
70 labelPair data_;
71
72
73 // Private Member Functions
74
75 //- Initialise data so it uses the nulltransformindex
76 inline void setNull(const globalIndexAndTransform& gt);
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&,
86 const scalar tol,
87 TrackingData& td
88 );
89
90
91public:
92
93 // Constructors
94
95 //- Default construct
96 inline wallPointAddressing();
97
98 //- Construct from origin, transforms, distance
100 (
101 const point& origin,
102 const labelPair& data,
103 const scalar distSqr
104 );
105
106
107 // Member Functions
108
109 // Access
110
111 const labelPair& data() const
112 {
113 return data_;
114 }
115 labelPair& data()
116 {
117 return data_;
118 }
119
120
121 // Needed by MeshWave
122
123 //- Convert any absolute coordinates into relative to (patch)face
124 //- centre
125 template<class TrackingData>
126 inline void leaveDomain
127 (
128 const polyMesh&,
129 const polyPatch&,
130 const label patchFacei,
131 const point& faceCentre,
132 TrackingData& td
133 );
134
135 //- Influence of neighbouring face.
136 // Calls update(...) with cellCentre of celli
137 template<class TrackingData>
138 inline bool updateCell
139 (
140 const polyMesh& mesh,
141 const label thisCelli,
142 const label neighbourFacei,
143 const wallPointAddressing& neighbourWallInfo,
144 const scalar tol,
145 TrackingData& td
146 );
147
148 //- Influence of neighbouring cell.
149 // Calls update(...) with faceCentre of facei
150 template<class TrackingData>
151 inline bool updateFace
152 (
153 const polyMesh& mesh,
154 const label thisFacei,
155 const label neighbourCelli,
156 const wallPointAddressing& neighbourWallInfo,
157 const scalar tol,
158 TrackingData& td
159 );
160
161 //- Influence of different value on same face.
162 // Merge new and old info.
163 // Calls update(...) with faceCentre of facei
164 template<class TrackingData>
165 inline bool updateFace
166 (
167 const polyMesh& mesh,
168 const label thisFacei,
169 const wallPointAddressing& neighbourWallInfo,
170 const scalar tol,
171 TrackingData& td
172 );
173
174
175 // IOstream Operators
176
179};
180
181
182// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
183
184//- Data are contiguous if data type is contiguous
185template<>
187: is_contiguous<wallPoint>
188{};
189
190template<>
191struct is_contiguous_scalar<wallPointAddressing>
192: is_contiguous_scalar<wallPoint>
193{};
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197} // End namespace Foam
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201#include "wallPointAddressingI.H"
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#endif
206
207// ************************************************************************* //
#define w2
Definition blockCreate.C:28
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Determination and storage of the possible independent transforms introduced by coupledPolyPatches,...
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
Holds information (coordinate and origin) regarding nearest wall point.
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const wallPointAddressing &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
friend Ostream & operator<<(Ostream &, const wallPointAddressing &)
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const wallPointAddressing &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
const labelPair & data() const
wallPointAddressing()
Default construct.
friend Istream & operator>>(Istream &, wallPointAddressing &)
void leaveDomain(const polyMesh &, const polyPatch &, const label patchFacei, const point &faceCentre, TrackingData &td)
Convert any absolute coordinates into relative to (patch)face centre.
const point & origin() const
Definition wallPoint.H:123
scalar distSqr() const
Definition wallPoint.H:132
wallPoint()
Default construct.
Definition wallPointI.H:92
mesh update()
dynamicFvMesh & mesh
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for OpenFOAM.
Pair< label > labelPair
A pair of labels.
Definition Pair.H:54
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
vector point
Point is a vector.
Definition point.H:37
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition contiguous.H:87
A template class to specify that a data type can be considered as being contiguous in memory.
Definition contiguous.H:70