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) 2011 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  Class polyTopoChanger Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class polyTopoChanger
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
78  polyMesh& 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  virtual ~polyTopoChanger()
97  {}
98 
99 
100  // Member functions
101 
102  //- Return the mesh reference
103  const polyMesh& mesh() const
104  {
105  return mesh_;
106  }
107 
108  //- Return a list of patch types
109  wordList types() const;
110 
111  //- Return a list of patch names
112  wordList names() const;
113 
114  //- Is topology change required
115  bool changeTopology() const;
116 
117  //- Return topology change request
119 
120  //- Modify point motion
121  void modifyMotionPoints(pointField&) const;
122 
124  (
125  const bool inflate,
126  const bool syncParallel = true,
127  const bool orderCells = false,
128  const bool orderPoints = false
129  );
130 
131  //- Force recalculation of locally stored data on topological change
132  void update(const mapPolyMesh& m);
133 
134  //- Add given set of topology modifiers to the topoChanger
136 
137  //- Find modifier given a name
138  label findModifierID(const word& modName) const;
139 
140 
141  //- writeData member function required by regIOobject
142  bool writeData(Ostream&) const;
143 
144 
145  // Member Operators
146 
147  bool operator!=(const polyTopoChanger&) const;
148  bool operator==(const polyTopoChanger&) const;
149 
150 
151  // Ostream operator
152 
153  friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
regIOobject.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::polyTopoChanger::~polyTopoChanger
virtual ~polyTopoChanger()
Destructor.
Definition: polyTopoChanger.H:95
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polyTopoChanger::polyTopoChanger
polyTopoChanger(const polyTopoChanger &)
Disallow default bitwise copy construct.
Foam::polyTopoChanger::TypeName
TypeName("polyTopoChanger")
Runtime type information.
Foam::polyTopoChanger::findModifierID
label findModifierID(const word &modName) const
Find modifier given a name.
Definition: polyTopoChanger.C:314
Foam::polyTopoChanger
List of mesh modifiers defining the mesh dynamics.
Definition: polyTopoChanger.H:56
Foam::polyTopoChanger::operator<<
friend Ostream & operator<<(Ostream &, const polyTopoChanger &)
Foam::polyTopoChanger::changeTopology
bool changeTopology() const
Is topology change required.
Definition: polyTopoChanger.C:160
Foam::polyTopoChanger::topoChangeRequest
autoPtr< polyTopoChange > topoChangeRequest() const
Return topology change request.
Definition: polyTopoChanger.C:206
Foam::polyTopoChanger::update
void update(const mapPolyMesh &m)
Force recalculation of locally stored data on topological change.
Definition: polyTopoChanger.C:240
Foam::polyTopoChanger::names
wordList names() const
Return a list of patch names.
Definition: polyTopoChanger.C:145
Foam::polyTopoChanger::addTopologyModifiers
void addTopologyModifiers(const List< polyMeshModifier * > &tm)
Add given set of topology modifiers to the topoChanger.
Definition: polyTopoChanger.C:291
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::polyTopoChanger::modifyMotionPoints
void modifyMotionPoints(pointField &) const
Modify point motion.
Definition: polyTopoChanger.C:226
Foam::polyTopoChanger::types
wordList types() const
Return a list of patch types.
Definition: polyTopoChanger.C:130
Foam::polyTopoChanger::readModifiers
void readModifiers()
Definition: polyTopoChanger.C:41
Foam::polyTopoChanger::operator!=
bool operator!=(const polyTopoChanger &) const
Definition: polyTopoChanger.C:349
Foam::polyTopoChanger::mesh_
polyMesh & mesh_
Reference to mesh.
Definition: polyTopoChanger.H:77
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyTopoChanger::writeData
bool writeData(Ostream &) const
writeData member function required by regIOobject
Definition: polyTopoChanger.C:340
Foam::polyTopoChanger::changeMesh
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Definition: polyTopoChanger.C:259
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:60
Foam::polyTopoChanger::operator==
bool operator==(const polyTopoChanger &) const
Definition: polyTopoChanger.C:355
Foam::polyTopoChanger::mesh
const polyMesh & mesh() const
Return the mesh reference.
Definition: polyTopoChanger.H:102
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::polyTopoChanger::operator=
void operator=(const polyTopoChanger &)
Disallow default bitwise assignment.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
PtrList.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
polyMeshModifier.H