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 | Copyright (C) 2015 OpenCFD Ltd.
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::transportData
26 
27 Description
28  Holds information (coordinate and distance). Walks out 0.5*distance.
29 
30 SourceFiles
31  transportDataI.H
32  transportData.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef transportData_H
37 #define transportData_H
38 
39 #include "wallPointData.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class polyMesh;
48 
49 /*---------------------------------------------------------------------------*\
50  Class transportData Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class transportData
54 :
55  public wallPointData<scalar>
56 {
57 public:
58 
59  //- Class used to pass additional data in
60  class trackData
61  {
62  public:
63 
64  //- Per face the index of the surface hit
65  const labelList& surfaceIndex_;
66 
67  trackData(const labelList& surfaceIndex)
68  :
69  surfaceIndex_(surfaceIndex)
70  {}
71  };
72 
73 
74 private:
75 
76  // Private Member Functions
77 
78  //- Evaluate distance to point. Update distSqr, origin from whomever
79  // is nearer pt. Return true if w2 is closer to point,
80  // false otherwise.
81  template<class TrackingData>
82  inline bool update
83  (
84  const point&,
85  const transportData& w2,
86  const scalar tol,
87  TrackingData& td
88  );
89 
90 public:
91 
92  // Constructors
93 
94  //- Construct null
95  inline transportData();
96 
97  //- Construct from origin, gapSize, distance
98  inline transportData
99  (
100  const point& origin,
101  const scalar gapSize,
102  const scalar distSqr
103  );
104 
105 
106  // Member Functions
107 
108  // Needed by FaceCellWave
109 
110  //- Influence of neighbouring face.
111  // Calls update(...) with cellCentre of cellI
112  template<class TrackingData>
113  inline bool updateCell
114  (
115  const polyMesh& mesh,
116  const label thisCellI,
117  const label neighbourFaceI,
118  const transportData& neighbourWallInfo,
119  const scalar tol,
120  TrackingData& td
121  );
122 
123  //- Influence of neighbouring cell.
124  // Calls update(...) with faceCentre of faceI
125  template<class TrackingData>
126  inline bool updateFace
127  (
128  const polyMesh& mesh,
129  const label thisFaceI,
130  const label neighbourCellI,
131  const transportData& neighbourWallInfo,
132  const scalar tol,
133  TrackingData& td
134  );
135 
136  //- Influence of different value on same face.
137  // Merge new and old info.
138  // Calls update(...) with faceCentre of faceI
139  template<class TrackingData>
140  inline bool updateFace
141  (
142  const polyMesh& mesh,
143  const label thisFaceI,
144  const transportData& neighbourWallInfo,
145  const scalar tol,
146  TrackingData& td
147  );
148 };
149 
150 
151 //- Data associated with transportData type is same as underlying
152 template<>
153 inline bool contiguous<transportData>()
154 {
155  return contiguous<wallPointData<scalar> >();
156 }
157 
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:52
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:101
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:131
Foam::transportData::trackData
Class used to pass additional data in.
Definition: transportData.H:59
Foam::contiguous< transportData >
bool contiguous< transportData >()
Data associated with transportData type is same as underlying.
Definition: transportData.H:152
transportDataI.H
Foam::transportData::trackData::trackData
trackData(const labelList &surfaceIndex)
Definition: transportData.H:66
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::transportData::transportData
transportData()
Construct null.
Definition: transportDataI.H:80
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
wallPointData.H
Foam::transportData::trackData::surfaceIndex_
const labelList & surfaceIndex_
Per face the index of the surface hit.
Definition: transportData.H:64
Foam::transportData::update
bool update(const point &, const transportData &w2, const scalar tol, TrackingData &td)
Evaluate distance to point. Update distSqr, origin from whomever.
Definition: transportDataI.H:34
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::wallPointData
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:48