1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 FaceCellWave plus data
33 \*---------------------------------------------------------------------------*/
38 #include "FaceCellWave.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class MeshWaveName Declaration
47 \*---------------------------------------------------------------------------*/
49 TemplateName(MeshWave);
52 /*---------------------------------------------------------------------------*\
53 Class MeshWave Declaration
54 \*---------------------------------------------------------------------------*/
56 template <class Type, class TrackingData = int>
63 //- Wall information for all faces
64 List<Type> allFaceInfo_;
66 //- Wall information for all cells
67 List<Type> allCellInfo_;
69 //- Wave calculation engine.
70 FaceCellWave<Type, TrackingData> calc_;
72 // Private Member Functions
74 //- Disallow default bitwise copy construct
75 MeshWave(const MeshWave&);
77 //- Disallow default bitwise assignment
78 void operator=(const MeshWave&);
80 // Private static data
82 //- Used as default trackdata value to satisfy default template
84 static label dummyTrackData_;
90 //- Construct from mesh and list of changed faces with the Type
91 // for these faces. Iterates until nothing changes or maxIter reached.
96 const labelList& initialChangedFaces,
97 const List<Type>& changedFacesInfo,
99 TrackingData& td = dummyTrackData_
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)
108 const polyMesh& mesh,
109 const labelList& initialChangedFaces,
110 const List<Type>& changedFacesInfo,
111 const List<Type>& allCellInfo,
113 TrackingData& td = dummyTrackData_
120 const List<Type>& allFaceInfo() const
126 const List<Type>& allCellInfo() const
131 //- Additional data to be passed into container
132 const TrackingData& data() const
137 //- Iterate until no changes or maxIter reached. Returns actual
138 // number of iterations.
139 label iterate(const label maxIter)
141 return calc_.iterate(maxIter);
144 //- Get number of unvisited cells, i.e. cells that were not (yet)
145 // reached from walking across mesh. This can happen from
146 // - not enough iterations done
147 // - a disconnected mesh
148 // - a mesh without walls in it
149 label getUnsetCells() const
151 return calc_.getUnsetCells();
154 //- Get number of unvisited faces
155 label getUnsetFaces() const
157 return calc_.getUnsetFaces();
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 # include "MeshWave.C"
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //