initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / algorithms / MeshWave / MeshWave.H
blobe9de09517f1662033d2e6c8d5309e6a8d0bef97e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::MeshWave
28 Description
29     FaceCellWave plus data
31 SourceFiles
32     MeshWave.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef MeshWave_H
37 #define MeshWave_H
39 #include "FaceCellWave.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                         Class MeshWaveName Declaration
48 \*---------------------------------------------------------------------------*/
50 TemplateName(MeshWave);
53 /*---------------------------------------------------------------------------*\
54                            Class MeshWave Declaration
55 \*---------------------------------------------------------------------------*/
57 template <class Type>
58 class MeshWave
60     public MeshWaveName
62     // Private data
64         //- Wall information for all faces
65         List<Type> allFaceInfo_;
67         //- Wall information for all cells
68         List<Type> allCellInfo_;
70         //- Wave calculation engine.
71         FaceCellWave<Type> calc_;
73     // Private Member Functions
75         //- Disallow default bitwise copy construct
76         MeshWave(const MeshWave&);
78         //- Disallow default bitwise assignment
79         void operator=(const MeshWave&);
81 public:
83     // Constructors
85         //- Construct from mesh and list of changed faces with the Type
86         //  for these faces. Iterates until nothing changes or maxIter reached.
87         //  (maxIter can be 0)
88         MeshWave
89         (
90             const polyMesh& mesh,
91             const labelList& initialChangedFaces,
92             const List<Type>& changedFacesInfo,
93             const label maxIter
94         );
96         //- Construct from mesh, list of changed faces with the Type
97         //  for these faces and initial field.
98         //  Iterates until nothing changes or maxIter reached.
99         //  (maxIter can be 0)
100         MeshWave
101         (
102             const polyMesh& mesh,
103             const labelList& initialChangedFaces,
104             const List<Type>& changedFacesInfo,
105             const List<Type>& allCellInfo,
106             const label maxIter
107         );
110     // Member Functions
112         //- Get allFaceInfo
113         const List<Type>& allFaceInfo() const
114         {
115             return allFaceInfo_;
116         }
118         //- Get allCellInfo
119         const List<Type>& allCellInfo() const
120         {
121             return allCellInfo_;
122         }
125         //- Iterate until no changes or maxIter reached. Returns number of
126         //  unset cells (see getUnsetCells)
127         label iterate(const label maxIter)
128         {
129             return calc_.iterate(maxIter);
130         }
132         //- Get number of unvisited cells, i.e. cells that were not (yet)
133         //  reached from walking across mesh. This can happen from
134         //  - not enough iterations done
135         //  - a disconnected mesh
136         //  - a mesh without walls in it
137         label getUnsetCells() const
138         {
139             return calc_.getUnsetCells();
140         }
142         //- Get number of unvisited faces
143         label getUnsetFaces() const
144         {
145             return calc_.getUnsetFaces();
146         }
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #ifdef NoRepository
158 #   include "MeshWave.C"
159 #endif
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #endif
165 // ************************************************************************* //