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::polyTopoChanger 00026 00027 Description 00028 List of mesh modifiers defining the mesh dynamics. 00029 00030 SourceFiles 00031 polyTopoChanger.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef polyTopoChanger_H 00036 #define polyTopoChanger_H 00037 00038 #include <OpenFOAM/regIOobject.H> 00039 #include <OpenFOAM/PtrList.H> 00040 #include <dynamicMesh/polyMeshModifier.H> 00041 00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00043 00044 namespace Foam 00045 { 00046 00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00048 00049 class polyMesh; 00050 class mapPolyMesh; 00051 class polyBoundaryMesh; 00052 00053 /*---------------------------------------------------------------------------*\ 00054 Class polyTopoChanger Declaration 00055 \*---------------------------------------------------------------------------*/ 00056 00057 class polyTopoChanger 00058 : 00059 public PtrList<polyMeshModifier>, 00060 public regIOobject 00061 { 00062 // Private Member Functions 00063 00064 //- Disallow default bitwise copy construct 00065 polyTopoChanger(const polyTopoChanger&); 00066 00067 //- Disallow default bitwise assignment 00068 void operator=(const polyTopoChanger&); 00069 00070 void readModifiers(); 00071 00072 00073 protected: 00074 00075 // Protected data 00076 00077 //- Reference to mesh 00078 polyMesh& mesh_; 00079 00080 public: 00081 00082 //- Runtime type information 00083 TypeName("polyTopoChanger"); 00084 00085 00086 // Constructors 00087 00088 //- Read constructor given IOobject and a polyMesh 00089 polyTopoChanger(const IOobject&, polyMesh&); 00090 00091 //- Read constructor for given polyMesh 00092 explicit polyTopoChanger(polyMesh&); 00093 00094 00095 // Destructor 00096 00097 virtual ~polyTopoChanger() 00098 {} 00099 00100 00101 // Member functions 00102 00103 //- Return the mesh reference 00104 const polyMesh& mesh() const 00105 { 00106 return mesh_; 00107 } 00108 00109 //- Return a list of patch types 00110 wordList types() const; 00111 00112 //- Return a list of patch names 00113 wordList names() const; 00114 00115 //- Is topology change required 00116 bool changeTopology() const; 00117 00118 //- Return topology change request 00119 autoPtr<polyTopoChange> topoChangeRequest() const; 00120 00121 //- Modify point motion 00122 void modifyMotionPoints(pointField&) const; 00123 00124 autoPtr<mapPolyMesh> changeMesh 00125 ( 00126 const bool inflate, 00127 const bool syncParallel = true, 00128 const bool orderCells = false, 00129 const bool orderPoints = false 00130 ); 00131 00132 //- Force recalculation of locally stored data on topological change 00133 void update(const mapPolyMesh& m); 00134 00135 //- Add given set of topology modifiers to the topoChanger 00136 void addTopologyModifiers(const List<polyMeshModifier*>& tm); 00137 00138 //- Find modifier given a name 00139 label findModifierID(const word& modName) const; 00140 00141 00142 //- writeData member function required by regIOobject 00143 bool writeData(Ostream&) const; 00144 00145 00146 // Member Operators 00147 00148 bool operator!=(const polyTopoChanger&) const; 00149 bool operator==(const polyTopoChanger&) const; 00150 00151 00152 // Ostream operator 00153 00154 friend Ostream& operator<<(Ostream&, const polyTopoChanger&); 00155 }; 00156 00157 00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00159 00160 } // End namespace Foam 00161 00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00163 00164 #endif 00165 00166 // ************************ vim: set sw=4 sts=4 et: ************************ //