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::refinementIterator 00026 00027 Description 00028 Utility class to do iterating meshCutter until all requests satisfied. 00029 00030 Needed since cell cutting can only cut cell once in one go so if 00031 refinement pattern is not compatible on a cell by cell basis it will 00032 refuse to cut. 00033 00034 Parallel: communicates. All decisions done on 'reduce'd variable. 00035 00036 SourceFiles 00037 refinementIterator.C 00038 00039 \*---------------------------------------------------------------------------*/ 00040 00041 #ifndef refinementIterator_H 00042 #define refinementIterator_H 00043 00044 #include <dynamicMesh/edgeVertex.H> 00045 #include <OpenFOAM/labelList.H> 00046 #include <OpenFOAM/Map.H> 00047 #include <OpenFOAM/typeInfo.H> 00048 00049 00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00051 00052 namespace Foam 00053 { 00054 00055 // Forward declaration of classes 00056 class polyMesh; 00057 class refineCell; 00058 class undoableMeshCutter; 00059 class cellLooper; 00060 00061 /*---------------------------------------------------------------------------*\ 00062 Class refinementIterator Declaration 00063 \*---------------------------------------------------------------------------*/ 00064 00065 class refinementIterator 00066 : 00067 public edgeVertex 00068 { 00069 // Private data 00070 00071 //- Reference to mesh 00072 polyMesh& mesh_; 00073 00074 //- Reference to refinementEngine 00075 undoableMeshCutter& meshRefiner_; 00076 00077 //- Reference to object to walk individual cells 00078 const cellLooper& cellWalker_; 00079 00080 //- Whether to write intermediate meshes 00081 bool writeMesh_; 00082 00083 00084 public: 00085 00086 //- Runtime type information 00087 ClassName("refinementIterator"); 00088 00089 00090 // Constructors 00091 00092 //- Construct from mesh, refinementEngine and cell walking routine. 00093 // If writeMesh = true increments runTime and writes intermediate 00094 // meshes. 00095 refinementIterator 00096 ( 00097 polyMesh& mesh, 00098 undoableMeshCutter& meshRefiner, 00099 const cellLooper& cellWalker, 00100 const bool writeMesh = false 00101 ); 00102 00103 00104 // Destructor 00105 00106 ~refinementIterator(); 00107 00108 00109 // Member Functions 00110 00111 //- Try to refine cells in given direction. Constructs intermediate 00112 // meshes. Returns map from old to added cells. 00113 Map<label> setRefinement(const List<refineCell>&); 00114 00115 }; 00116 00117 00118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00119 00120 } // End namespace Foam 00121 00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00123 00124 #endif 00125 00126 // ************************ vim: set sw=4 sts=4 et: ************************ //