All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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  void readModifiers();
73 
74 
75 protected:
76 
77  // Protected data
78 
79  //- Reference to mesh
80  polyMesh& mesh_;
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("polyTopoChanger");
86 
87 
88  // Constructors
89 
90  //- Read constructor given IOobject and a polyMesh
92 
93  //- Read constructor for given polyMesh
94  explicit polyTopoChanger(polyMesh&);
95 
96  //- Disallow default bitwise copy construction
97  polyTopoChanger(const polyTopoChanger&) = delete;
98 
99 
100  //- Destructor
101  virtual ~polyTopoChanger()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return the mesh reference
108  const polyMesh& mesh() const
109  {
110  return mesh_;
111  }
112 
113  //- Return a list of patch types
114  wordList types() const;
115 
116  //- Return a list of patch names
117  wordList names() const;
118 
119  //- Is topology change required
120  bool changeTopology() const;
121 
122  //- Return topology change request
124 
125  //- Modify point motion
126  void modifyMotionPoints(pointField&) const;
127 
129  (
130  const bool inflate,
131  const bool syncParallel = true,
132  const bool orderCells = false,
133  const bool orderPoints = false
134  );
135 
136  //- Force recalculation of locally stored data on topological change
137  void update(const mapPolyMesh& m);
138 
139  //- Add given set of topology modifiers to the topoChanger
141 
142  //- Find modifier given a name
143  label findModifierID(const word& modName) const;
144 
145 
146  //- writeData member function required by regIOobject
147  bool writeData(Ostream&) const;
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const polyTopoChanger&) = delete;
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.
void operator=(const polyTopoChanger &)=delete
Disallow default bitwise assignment.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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:70
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:55
polyTopoChanger(const IOobject &, polyMesh &)
Read constructor given IOobject and a polyMesh.
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.