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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::transportData
28 
29 Description
30  Holds information (coordinate and distance). Walks out 0.5*distance.
31 
32 SourceFiles
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 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class transportData Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class transportData
56 :
57  public wallPointData<scalar>
58 {
59 public:
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
67  const labelList& surfaceIndex_;
68 
69  trackData(const labelList& surfaceIndex)
70  :
71  surfaceIndex_(surfaceIndex)
72  {}
73  };
74 
75 
76 private:
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 
92 public:
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
156 template<>
157 struct 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 // ************************************************************************* //
Foam::transportData
Holds information (coordinate and distance). Walks out 0.5*distance.
Definition: transportData.H:54
Foam::transportData::updateCell
bool updateCell(const polyMesh &mesh, const label thisCellI, const label neighbourFaceI, const transportData &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: transportDataI.H:103
Foam::transportData::updateFace
bool updateFace(const polyMesh &mesh, const label thisFaceI, const label neighbourCellI, const transportData &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: transportDataI.H:133
Foam::transportData::trackData
Class used to pass additional data in.
Definition: transportData.H:61
transportDataI.H
Foam::transportData::trackData::trackData
trackData(const labelList &surfaceIndex)
Definition: transportData.H:68
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::transportData::transportData
transportData()
Construct null.
Definition: transportDataI.H:82
wallPointData.H
Foam::transportData::trackData::surfaceIndex_
const labelList & surfaceIndex_
Per face the index of the surface hit.
Definition: transportData.H:66
w2
#define w2
Definition: blockCreate.C:35
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector< scalar >
Foam::List< label >
Foam::wallPointData
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:52
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75