transportData.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) 2015-2020 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::transportData
28
29Description
30 Holds information (coordinate and distance). Walks out 0.5*distance.
31
32SourceFiles
33 transportDataI.H
34 transportData.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef transportData_H
39#define transportData_H
40
41#include "wallPointData.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48// Forward Declarations
49class polyMesh;
50
51/*---------------------------------------------------------------------------*\
52 Class transportData Declaration
53\*---------------------------------------------------------------------------*/
55class transportData
56:
57 public wallPointData<scalar>
58{
59public:
60
61 //- Class used to pass additional data in
62 class trackData
63 {
64 public:
65
66 //- Per face the index of the surface hit
69 trackData(const labelList& surfaceIndex)
70 :
71 surfaceIndex_(surfaceIndex)
72 {}
73 };
74
75
76private:
77
78 // Private Member Functions
79
80 //- Evaluate distance to point.
81 // Update distSqr, origin from whomever is nearer pt.
82 // \return true if w2 is closer to point, false otherwise.
83 template<class TrackingData>
84 inline bool update
85 (
86 const point&,
87 const transportData& w2,
88 const scalar tol,
89 TrackingData& td
90 );
91
92public:
93
94 // Constructors
95
96 //- Construct null
97 inline transportData();
98
99 //- Construct from origin, gapSize, distance
100 inline transportData
101 (
102 const point& origin,
103 const scalar gapSize,
104 const scalar distSqr
105 );
106
107
108 // Member Functions
109
110 // Needed by FaceCellWave
111
112 //- Influence of neighbouring face.
113 // Calls update(...) with cellCentre of cellI
114 template<class TrackingData>
115 inline bool updateCell
116 (
117 const polyMesh& mesh,
118 const label thisCellI,
119 const label neighbourFaceI,
120 const transportData& neighbourWallInfo,
121 const scalar tol,
122 TrackingData& td
123 );
124
125 //- Influence of neighbouring cell.
126 // Calls update(...) with faceCentre of faceI
127 template<class TrackingData>
128 inline bool updateFace
129 (
130 const polyMesh& mesh,
131 const label thisFaceI,
132 const label neighbourCellI,
133 const transportData& neighbourWallInfo,
134 const scalar tol,
135 TrackingData& td
136 );
137
138 //- Influence of different value on same face.
139 // Merge new and old info.
140 // Calls update(...) with faceCentre of faceI
141 template<class TrackingData>
142 inline bool updateFace
143 (
144 const polyMesh& mesh,
145 const label thisFaceI,
146 const transportData& neighbourWallInfo,
147 const scalar tol,
148 TrackingData& td
149 );
150};
151
152
153// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
154
155//- Contiguous data for transportData
156template<>
157struct is_contiguous<transportData> : is_contiguous<wallPointData<scalar>> {};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#include "transportDataI.H"
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170#endif
171
172// ************************************************************************* //
#define w2
Definition: blockCreate.C:35
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Class used to pass additional data in.
Definition: transportData.H:62
const labelList & surfaceIndex_
Per face the index of the surface hit.
Definition: transportData.H:66
trackData(const labelList &surfaceIndex)
Definition: transportData.H:68
Holds information (coordinate and distance). Walks out 0.5*distance.
Definition: transportData.H:57
bool updateFace(const polyMesh &mesh, const label thisFaceI, const label neighbourCellI, const transportData &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
transportData()
Construct null.
bool updateCell(const polyMesh &mesh, const label thisCellI, const label neighbourFaceI, const transportData &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:66
const point & origin() const
Definition: wallPoint.H:106
scalar distSqr() const
Definition: wallPoint.H:115
mesh update()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78