polyTopoChanger.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
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 "regIOobject.H"
39 #include "PtrList.H"
40 #include "polyMeshModifier.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 class polyMesh;
50 class mapPolyMesh;
51 class polyBoundaryMesh;
52 
53 
54 // Forward declaration of friend functions and operators
55 
56 class polyTopoChanger;
57 
58 Ostream& operator<<(Ostream&, const polyTopoChanger&);
59 
60 
61 /*---------------------------------------------------------------------------*\
62  Class polyTopoChanger Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class polyTopoChanger
66 :
67  public PtrList<polyMeshModifier>,
68  public regIOobject
69 {
70  // Private Member Functions
71 
72  //- Disallow default bitwise copy construct
74 
75  //- Disallow default bitwise assignment
76  void operator=(const polyTopoChanger&);
77 
78  void readModifiers();
79 
80 
81 protected:
82 
83  // Protected data
84 
85  //- Reference to mesh
86  polyMesh& mesh_;
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("polyTopoChanger");
92 
93 
94  // Constructors
95 
96  //- Read constructor given IOobject and a polyMesh
98 
99  //- Read constructor for given polyMesh
100  explicit polyTopoChanger(polyMesh&);
101 
102 
103  //- Destructor
104  virtual ~polyTopoChanger()
105  {}
106 
107 
108  // Member functions
109 
110  //- Return the mesh reference
111  const polyMesh& mesh() const
112  {
113  return mesh_;
114  }
115 
116  //- Return a list of patch types
117  wordList types() const;
118 
119  //- Return a list of patch names
120  wordList names() const;
121 
122  //- Is topology change required
123  bool changeTopology() const;
124 
125  //- Return topology change request
127 
128  //- Modify point motion
129  void modifyMotionPoints(pointField&) const;
130 
132  (
133  const bool inflate,
134  const bool syncParallel = true,
135  const bool orderCells = false,
136  const bool orderPoints = false
137  );
138 
139  //- Force recalculation of locally stored data on topological change
140  void update(const mapPolyMesh& m);
141 
142  //- Add given set of topology modifiers to the topoChanger
144 
145  //- Find modifier given a name
146  label findModifierID(const word& modName) const;
147 
148 
149  //- writeData member function required by regIOobject
150  bool writeData(Ostream&) const;
151 
152 
153  // Member Operators
154 
155  bool operator!=(const polyTopoChanger&) const;
156  bool operator==(const polyTopoChanger&) const;
157 
158 
159  // Ostream operator
160 
161  friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
autoPtr< polyTopoChange > topoChangeRequest() const
Return topology change request.
void update(const mapPolyMesh &m)
Force recalculation of locally stored data on topological change.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool operator!=(const polyTopoChanger &) const
polyMesh & mesh_
Reference to mesh.
label findModifierID(const word &modName) const
Find modifier given a name.
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
bool changeTopology() const
Is topology change required.
List of mesh modifiers defining the mesh dynamics.
A class for handling words, derived from string.
Definition: word.H:59
void modifyMotionPoints(pointField &) const
Modify point motion.
wordList types() const
Return a list of patch types.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
bool writeData(Ostream &) const
writeData member function required by regIOobject
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
Ostream & operator<<(Ostream &, const ensightPart &)
virtual ~polyTopoChanger()
Destructor.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
TypeName("polyTopoChanger")
Runtime type information.
bool operator==(const polyTopoChanger &) const
const polyMesh & mesh() const
Return the mesh reference.
void addTopologyModifiers(const List< polyMeshModifier *> &tm)
Add given set of topology modifiers to the topoChanger.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
friend Ostream & operator<<(Ostream &, const polyTopoChanger &)
Namespace for OpenFOAM.
wordList names() const
Return a list of patch names.