initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / polyTopoChange / polyTopoChanger / polyTopoChanger.H
bloba4d5f8c53ff72cef9c273a98f240d26b9dc1e2f7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::polyTopoChanger
28 Description
29     List of mesh modifiers defining the mesh dynamics.
31 SourceFiles
32     polyTopoChanger.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef polyTopoChanger_H
37 #define polyTopoChanger_H
39 #include "regIOobject.H"
40 #include "PtrList.H"
41 #include "polyMeshModifier.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 class polyMesh;
51 class mapPolyMesh;
52 class polyBoundaryMesh;
54 /*---------------------------------------------------------------------------*\
55                       Class polyTopoChanger Declaration
56 \*---------------------------------------------------------------------------*/
58 class polyTopoChanger
60     public PtrList<polyMeshModifier>,
61     public regIOobject
63     // Private Member Functions
65         //- Disallow default bitwise copy construct
66         polyTopoChanger(const polyTopoChanger&);
68         //- Disallow default bitwise assignment
69         void operator=(const polyTopoChanger&);
71         void readModifiers();
74 protected:
76     // Protected data
78         //- Reference to mesh
79         polyMesh& mesh_;
81 public:
83     //- Runtime type information
84     TypeName("polyTopoChanger");
87     // Constructors
89         //- Read constructor given IOobject and a polyMesh
90         polyTopoChanger(const IOobject&, polyMesh&);
92         //- Read constructor for given polyMesh
93         explicit polyTopoChanger(polyMesh&);
96     // Destructor
98         virtual ~polyTopoChanger()
99         {}
102     // Member functions
104         //- Return the mesh reference
105         const polyMesh& mesh() const
106         {
107             return mesh_;
108         }
110         //- Return a list of patch types
111         wordList types() const;
113         //- Return a list of patch names
114         wordList names() const;
116         //- Is topology change required
117         bool changeTopology() const;
119         //- Return topology change request
120         autoPtr<polyTopoChange> topoChangeRequest() const;
122         //- Modify point motion
123         void modifyMotionPoints(pointField&) const;
125         autoPtr<mapPolyMesh> changeMesh
126         (
127             const bool inflate,
128             const bool syncParallel = true,
129             const bool orderCells = false,
130             const bool orderPoints = false
131         );
133         //- Force recalculation of locally stored data on topological change
134         void update(const mapPolyMesh& m);
136         //- Add given set of topology modifiers to the topoChanger
137         void addTopologyModifiers(const List<polyMeshModifier*>& tm);
139         //- Find modifier given a name
140         label findModifierID(const word& modName) const;
143         //- writeData member function required by regIOobject
144         bool writeData(Ostream&) const;
147     // Member Operators
149         bool operator!=(const polyTopoChanger&) const;
150         bool operator==(const polyTopoChanger&) const;
153     // Ostream operator
155         friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace Foam
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #endif
167 // ************************************************************************* //