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