Loading...
Searching...
No Matches
MeshWave.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) 2020-2022 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::MeshWave
29
30Description
31 FaceCellWave plus data
32
33SourceFiles
34 MeshWave.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_MeshWave_H
39#define Foam_MeshWave_H
40
41#include "FaceCellWave.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
48/*---------------------------------------------------------------------------*\
49 Class MeshWaveName Declaration
50\*---------------------------------------------------------------------------*/
51
53
54
55/*---------------------------------------------------------------------------*\
56 Class MeshWave Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class Type, class TrackingData = int>
60class MeshWave
61:
62 public MeshWaveName
63{
64 // Private Data
65
66 //- Wall information for all faces
67 List<Type> allFaceInfo_;
68
69 //- Wall information for all cells
70 List<Type> allCellInfo_;
71
72 //- Wave calculation engine.
74
75
76 // Private Member Functions
77
78 //- No copy construct
79 MeshWave(const MeshWave&) = delete;
80
81 //- No copy assignment
82 void operator=(const MeshWave&) = delete;
83
84
85public:
86
87 // Constructors
88
89 //- Construct from mesh and list of changed faces with the Type
90 //- for these faces.
91 // Iterates until nothing changes or maxIter reached.
92 // (maxIter can be 0)
93 MeshWave
94 (
95 const polyMesh& mesh,
96 const labelUList& initialChangedFaces,
97 const UList<Type>& changedFacesInfo,
98 const label maxIter,
100 );
101
102 //- Construct from mesh, list of changed faces with the Type
103 //- for these faces and initial field.
104 // Iterates until nothing changes or maxIter reached.
105 // (maxIter can be 0)
106 MeshWave
107 (
108 const polyMesh& mesh,
109 const labelUList& initialChangedFaces,
110 const UList<Type>& changedFacesInfo,
112 const label maxIter,
114 );
115
116
117 // Member Functions
118
119 //- Get allFaceInfo
120 const List<Type>& allFaceInfo() const noexcept
121 {
122 return allFaceInfo_;
123 }
124
125 //- Get allCellInfo
126 const List<Type>& allCellInfo() const noexcept
127 {
128 return allCellInfo_;
129 }
130
131 //- Additional data to be passed into container
132 const TrackingData& data() const noexcept
134 return calc_.data();
135 }
136
137 //- Iterate until no changes or maxIter reached.
138 // \return actual number of iterations.
139 label iterate(const label maxIter)
140 {
141 return calc_.iterate(maxIter);
142 }
143
144 //- Current number of changed cells
145 label nChangedCells() const noexcept { return calc_.nChangedCells(); }
146
147 //- Current number of changed faces
148 label nChangedFaces() const noexcept { return calc_.nChangedFaces(); }
150 //- Number of unvisited cells
151 label nUnvisitedCells() const noexcept
152 {
153 return calc_.nUnvisitedCells();
154 }
155
156 //- Number of unvisited faces
157 label nUnvisitedFaces() const noexcept
158 {
159 return calc_.nUnvisitedFaces();
160 }
161};
162
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace Foam
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171#ifdef NoRepository
172 #include "MeshWave.C"
173#endif
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177#endif
178
179// ************************************************************************* //
label nChangedFaces() const noexcept
Current number of changed faces.
static int dummyTrackData_
Default trackData value (for default template argument).
label nChangedCells() const noexcept
Current number of changed cells.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
FaceCellWave plus data.
Definition MeshWave.H:58
label nChangedFaces() const noexcept
Current number of changed faces.
Definition MeshWave.H:172
label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
Definition MeshWave.H:159
const TrackingData & data() const noexcept
Additional data to be passed into container.
Definition MeshWave.H:149
label nChangedCells() const noexcept
Current number of changed cells.
Definition MeshWave.H:167
const List< Type > & allFaceInfo() const noexcept
Get allFaceInfo.
Definition MeshWave.H:133
label nUnvisitedFaces() const noexcept
Number of unvisited faces.
Definition MeshWave.H:185
label nUnvisitedCells() const noexcept
Number of unvisited cells.
Definition MeshWave.H:177
const List< Type > & allCellInfo() const noexcept
Get allCellInfo.
Definition MeshWave.H:141
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
#define TemplateName(TemplateNameString)
Add typeName information from argument TypeNameString to a.
Definition className.H:92
dynamicFvMesh & mesh
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75