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

removeCells.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::removeCells
00027 
00028 Description
00029     Given list of cells to remove insert all the topology changes.
00030 
00031     Works in two passes:
00032     - get faces that will become boundary faces
00033     - given these faces and the patches they have to go into make the
00034       changes.
00035 
00036 SourceFiles
00037     removeCells.C
00038 
00039 \*---------------------------------------------------------------------------*/
00040 
00041 #ifndef removeCells_H
00042 #define removeCells_H
00043 
00044 #include "labelList.H"
00045 #include "typeInfo.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 // Forward declaration of classes
00053 class polyMesh;
00054 class polyTopoChange;
00055 class mapPolyMesh;
00056 
00057 /*---------------------------------------------------------------------------*\
00058                            Class removeCells Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class removeCells
00062 {
00063     // Private data
00064 
00065         //- Reference to mesh
00066         const polyMesh& mesh_;
00067 
00068         //- Whether or not to synchronize parallel case.
00069         const bool syncPar_;
00070 
00071 
00072     // Private Member Functions
00073 
00074         //- Decrease count of elements of f
00075         static void uncount
00076         (
00077             const labelList& f,
00078             labelList& nUsage
00079         );
00080 
00081 
00082 public:
00083 
00084     //- Runtime type information
00085     ClassName("removeCells");
00086 
00087 
00088     // Constructors
00089 
00090         //- Construct from mesh. syncPar: do parallel synchronization.
00091         removeCells(const polyMesh& mesh, const bool syncPar = true);
00092 
00093 
00094     // Member Functions
00095 
00096         // Topology changes
00097 
00098             //- Get labels of exposed faces. These are
00099             //  - internal faces that become boundary faces
00100             //  - coupled faces that become uncoupled (since one of the sides
00101             //    gets deleted)
00102             labelList getExposedFaces(const labelList& cellsToRemove) const;
00103 
00104             //- Play commands into polyTopoChange to remove cells.
00105             //  patchIDs is for every element in facesToExpose (see above) the
00106             //  patch it has to go into. This cannot be a coupled patch!
00107             void setRefinement
00108             (
00109                 const labelList& cellsToRemove,
00110                 const labelList& facesToExpose,
00111                 const labelList& patchIDs,
00112                 polyTopoChange&
00113             ) const;
00114 
00115             //- Force recalculation of locally stored data on topological change
00116             void updateMesh(const mapPolyMesh&)
00117             {}
00118 
00119 };
00120 
00121 
00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00123 
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #endif
00129 
00130 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd