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::faceCollapser 00026 00027 Description 00028 Collapses faces into edges. Used to remove sliver faces (faces with small 00029 area but non-zero span). 00030 00031 Passed in as 00032 - face label 00033 - the two indices in the face (fpA, fpB) which delimit the vertices to be 00034 kept. 00035 00036 Takes the vertices outside the range fpA..fpB and projects them onto the 00037 kept edges (edges using kept vertices only). 00038 00039 Note: 00040 - Use in combination with edge collapse to cleanup meshes. 00041 - Can not remove cells so will mess up trying to remove a face on a tet. 00042 - WIP. Should be combined with edge collapsing and cell collapsing into 00043 proper 'collapser'. 00044 - Caller is responsible for making sure kept vertices (fpA..fpB) for one 00045 face are not the vertices to be removed for another face. 00046 00047 SourceFiles 00048 faceCollapser.C 00049 00050 \*---------------------------------------------------------------------------*/ 00051 00052 #ifndef faceCollapser_H 00053 #define faceCollapser_H 00054 00055 #include <OpenFOAM/labelList.H> 00056 #include <OpenFOAM/point.H> 00057 #include <OpenFOAM/Map.H> 00058 #include <OpenFOAM/HashSet.H> 00059 #include <OpenFOAM/typeInfo.H> 00060 #include <OpenFOAM/edgeList.H> 00061 00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00063 00064 namespace Foam 00065 { 00066 00067 // Forward declaration of classes 00068 class polyMesh; 00069 class polyTopoChange; 00070 class mapPolyMesh; 00071 00072 /*---------------------------------------------------------------------------*\ 00073 Class faceCollapser Declaration 00074 \*---------------------------------------------------------------------------*/ 00075 00076 class faceCollapser 00077 { 00078 // Private data 00079 00080 //- Reference to mesh 00081 const polyMesh& mesh_; 00082 00083 00084 // Static Functions 00085 00086 //- Insert labelList into labelHashSet. Optional excluded element. 00087 static void insert 00088 ( 00089 const labelList& elems, 00090 const label excludeElem, 00091 labelHashSet& set 00092 ); 00093 00094 //- Find edge amongst candidate edges. 00095 static label findEdge 00096 ( 00097 const edgeList& edges, 00098 const labelList& edgeLabels, 00099 const label v0, 00100 const label v1 00101 ); 00102 00103 00104 // Private Member Functions 00105 00106 //- Replace vertices in face 00107 void filterFace 00108 ( 00109 const Map<labelList>& splitEdges, 00110 const label faceI, 00111 polyTopoChange& meshMod 00112 ) const; 00113 00114 00115 //- Disallow default bitwise copy construct 00116 faceCollapser(const faceCollapser&); 00117 00118 //- Disallow default bitwise assignment 00119 void operator=(const faceCollapser&); 00120 00121 00122 public: 00123 00124 //- Runtime type information 00125 ClassName("faceCollapser"); 00126 00127 00128 // Constructors 00129 00130 //- Construct from mesh. 00131 faceCollapser(const polyMesh& mesh); 00132 00133 00134 // Member Functions 00135 00136 // Edit 00137 00138 //- Collapse faces along endpoints. Play commands into 00139 // polyTopoChange to create mesh. 00140 void setRefinement 00141 ( 00142 const labelList& faceLabels, 00143 const labelList& fpA, 00144 const labelList& fpB, 00145 polyTopoChange& 00146 ) const; 00147 00148 //- Update stored quantities for new mesh labels. 00149 void updateMesh(const mapPolyMesh&) 00150 {} 00151 }; 00152 00153 00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00155 00156 } // End namespace Foam 00157 00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00159 00160 #endif 00161 00162 // ************************ vim: set sw=4 sts=4 et: ************************ //