![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 refinementIterator 00027 00028 Description 00029 Utility class to do iterating meshCutter until all requests 00030 satisfied. Needed since cell cutting can only cut cell once in one go so 00031 if 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 "edgeVertex.H" 00045 #include "labelList.H" 00046 #include "Map.H" 00047 #include "typeInfo.H" 00048 00049 00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00051 00052 namespace Foam 00053 { 00054 00055 // Class forward declarations 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 // ************************************************************************* //