OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

polyTopoChanger.H

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