FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::MeshWave
00026 
00027 Description
00028     FaceCellWave plus data
00029 
00030 SourceFiles
00031     MeshWave.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef MeshWave_H
00036 #define MeshWave_H
00037 
00038 #include <OpenFOAM/FaceCellWave.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                         Class MeshWaveName Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 TemplateName(MeshWave);
00050 
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class MeshWave Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 template <class Type>
00057 class MeshWave
00058 :
00059     public MeshWaveName
00060 {
00061     // Private data
00062 
00063         //- Wall information for all faces
00064         List<Type> allFaceInfo_;
00065 
00066         //- Wall information for all cells
00067         List<Type> allCellInfo_;
00068 
00069         //- Wave calculation engine.
00070         FaceCellWave<Type> calc_;
00071 
00072     // Private Member Functions
00073 
00074         //- Disallow default bitwise copy construct
00075         MeshWave(const MeshWave&);
00076 
00077         //- Disallow default bitwise assignment
00078         void operator=(const MeshWave&);
00079 
00080 public:
00081 
00082     // Constructors
00083 
00084         //- Construct from mesh and list of changed faces with the Type
00085         //  for these faces. Iterates until nothing changes or maxIter reached.
00086         //  (maxIter can be 0)
00087         MeshWave
00088         (
00089             const polyMesh& mesh,
00090             const labelList& initialChangedFaces,
00091             const List<Type>& changedFacesInfo,
00092             const label maxIter
00093         );
00094 
00095         //- Construct from mesh, list of changed faces with the Type
00096         //  for these faces and initial field.
00097         //  Iterates until nothing changes or maxIter reached.
00098         //  (maxIter can be 0)
00099         MeshWave
00100         (
00101             const polyMesh& mesh,
00102             const labelList& initialChangedFaces,
00103             const List<Type>& changedFacesInfo,
00104             const List<Type>& allCellInfo,
00105             const label maxIter
00106         );
00107 
00108 
00109     // Member Functions
00110 
00111         //- Get allFaceInfo
00112         const List<Type>& allFaceInfo() const
00113         {
00114             return allFaceInfo_;
00115         }
00116 
00117         //- Get allCellInfo
00118         const List<Type>& allCellInfo() const
00119         {
00120             return allCellInfo_;
00121         }
00122 
00123 
00124         //- Iterate until no changes or maxIter reached. Returns number of
00125         //  unset cells (see getUnsetCells)
00126         label iterate(const label maxIter)
00127         {
00128             return calc_.iterate(maxIter);
00129         }
00130 
00131         //- Get number of unvisited cells, i.e. cells that were not (yet)
00132         //  reached from walking across mesh. This can happen from
00133         //  - not enough iterations done
00134         //  - a disconnected mesh
00135         //  - a mesh without walls in it
00136         label getUnsetCells() const
00137         {
00138             return calc_.getUnsetCells();
00139         }
00140 
00141         //- Get number of unvisited faces
00142         label getUnsetFaces() const
00143         {
00144             return calc_.getUnsetFaces();
00145         }
00146 };
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 #ifdef NoRepository
00157 #   include <OpenFOAM/MeshWave.C>
00158 #endif
00159 
00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00161 
00162 #endif
00163 
00164 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines