FreeFOAM The Cross-Platform CFD Toolkit
polyTopoChanger.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::polyTopoChanger
26 
27 Description
28  List of mesh modifiers defining the mesh dynamics.
29 
30 SourceFiles
31  polyTopoChanger.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef polyTopoChanger_H
36 #define polyTopoChanger_H
37 
38 #include <OpenFOAM/regIOobject.H>
39 #include <OpenFOAM/PtrList.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 class polyMesh;
50 class mapPolyMesh;
51 class polyBoundaryMesh;
52 
53 /*---------------------------------------------------------------------------*\
54  Class polyTopoChanger Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public PtrList<polyMeshModifier>,
60  public regIOobject
61 {
62  // Private Member Functions
63 
64  //- Disallow default bitwise copy construct
66 
67  //- Disallow default bitwise assignment
68  void operator=(const polyTopoChanger&);
69 
70  void readModifiers();
71 
72 
73 protected:
74 
75  // Protected data
76 
77  //- Reference to mesh
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("polyTopoChanger");
84 
85 
86  // Constructors
87 
88  //- Read constructor given IOobject and a polyMesh
90 
91  //- Read constructor for given polyMesh
92  explicit polyTopoChanger(polyMesh&);
93 
94 
95  // Destructor
96 
97  virtual ~polyTopoChanger()
98  {}
99 
100 
101  // Member functions
102 
103  //- Return the mesh reference
104  const polyMesh& mesh() const
105  {
106  return mesh_;
107  }
108 
109  //- Return a list of patch types
110  wordList types() const;
111 
112  //- Return a list of patch names
113  wordList names() const;
114 
115  //- Is topology change required
116  bool changeTopology() const;
117 
118  //- Return topology change request
120 
121  //- Modify point motion
122  void modifyMotionPoints(pointField&) const;
123 
125  (
126  const bool inflate,
127  const bool syncParallel = true,
128  const bool orderCells = false,
129  const bool orderPoints = false
130  );
131 
132  //- Force recalculation of locally stored data on topological change
133  void update(const mapPolyMesh& m);
134 
135  //- Add given set of topology modifiers to the topoChanger
137 
138  //- Find modifier given a name
139  label findModifierID(const word& modName) const;
140 
141 
142  //- writeData member function required by regIOobject
143  bool writeData(Ostream&) const;
144 
145 
146  // Member Operators
147 
148  bool operator!=(const polyTopoChanger&) const;
149  bool operator==(const polyTopoChanger&) const;
150 
151 
152  // Ostream operator
153 
154  friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************ vim: set sw=4 sts=4 et: ************************ //