OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

MeshWave.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::MeshWave
00027 
00028 Description
00029     FaceCellWave plus data
00030 
00031 SourceFiles
00032     MeshWave.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef MeshWave_H
00037 #define MeshWave_H
00038 
00039 #include "FaceCellWave.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                         Class MeshWaveName Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 TemplateName(MeshWave);
00051 
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class MeshWave Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 template <class Type>
00058 class MeshWave
00059 :
00060     public MeshWaveName
00061 {
00062     // Private data
00063 
00064         //- Wall information for all faces
00065         List<Type> allFaceInfo_;
00066 
00067         //- Wall information for all cells
00068         List<Type> allCellInfo_;
00069 
00070         //- Wave calculation engine.
00071         FaceCellWave<Type> calc_;
00072 
00073     // Private Member Functions
00074 
00075         //- Disallow default bitwise copy construct
00076         MeshWave(const MeshWave&);
00077 
00078         //- Disallow default bitwise assignment
00079         void operator=(const MeshWave&);
00080 
00081 public:
00082 
00083     // Constructors
00084 
00085         //- Construct from mesh and list of changed faces with the Type
00086         //  for these faces. Iterates until nothing changes or maxIter reached.
00087         //  (maxIter can be 0)
00088         MeshWave
00089         (
00090             const polyMesh& mesh,
00091             const labelList& initialChangedFaces,
00092             const List<Type>& changedFacesInfo,
00093             const label maxIter
00094         );
00095 
00096         //- Construct from mesh, list of changed faces with the Type
00097         //  for these faces and initial field.
00098         //  Iterates until nothing changes or maxIter reached.
00099         //  (maxIter can be 0)
00100         MeshWave
00101         (
00102             const polyMesh& mesh,
00103             const labelList& initialChangedFaces,
00104             const List<Type>& changedFacesInfo,
00105             const List<Type>& allCellInfo,
00106             const label maxIter
00107         );
00108 
00109 
00110     // Member Functions
00111 
00112         //- Get allFaceInfo
00113         const List<Type>& allFaceInfo() const
00114         {
00115             return allFaceInfo_;
00116         }
00117 
00118         //- Get allCellInfo
00119         const List<Type>& allCellInfo() const
00120         {
00121             return allCellInfo_;
00122         }
00123 
00124 
00125         //- Iterate until no changes or maxIter reached. Returns number of
00126         //  unset cells (see getUnsetCells)
00127         label iterate(const label maxIter)
00128         {
00129             return calc_.iterate(maxIter);
00130         }
00131 
00132         //- Get number of unvisited cells, i.e. cells that were not (yet)
00133         //  reached from walking across mesh. This can happen from
00134         //  - not enough iterations done
00135         //  - a disconnected mesh
00136         //  - a mesh without walls in it
00137         label getUnsetCells() const
00138         {
00139             return calc_.getUnsetCells();
00140         }
00141 
00142         //- Get number of unvisited faces
00143         label getUnsetFaces() const
00144         {
00145             return calc_.getUnsetFaces();
00146         }
00147 };
00148 
00149 
00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00151 
00152 } // End namespace Foam
00153 
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 #ifdef NoRepository
00158 #   include "MeshWave.C"
00159 #endif
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #endif
00164 
00165 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd