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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2017-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::polyTopoChanger
29 
30 Description
31  List of mesh modifiers defining the mesh dynamics.
32 
33 SourceFiles
34  polyTopoChanger.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef polyTopoChanger_H
39 #define polyTopoChanger_H
40 
41 #include "regIOobject.H"
42 #include "PtrList.H"
43 #include "polyMeshModifier.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 class polyMesh;
52 class mapPolyMesh;
53 class polyBoundaryMesh;
54 class polyTopoChanger;
55 
56 Ostream& operator<<(Ostream&, const polyTopoChanger&);
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class polyTopoChanger Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class polyTopoChanger
64 :
65  public PtrList<polyMeshModifier>,
66  public regIOobject
67 {
68  // Private Member Functions
69 
70  void readModifiers();
71 
72  //- No copy construct
73  polyTopoChanger(const polyTopoChanger&) = delete;
74 
75  //- No copy assignment
76  void operator=(const polyTopoChanger&) = delete;
77 
78 
79 protected:
80 
81  // Protected data
82 
83  //- Reference to mesh
84  polyMesh& mesh_;
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("polyTopoChanger");
90 
91 
92  // Constructors
93 
94  //- Read construct given IOobject and a polyMesh
96 
97  //- Read construct for given polyMesh and read-option
99 
100  //- Read construct for given polyMesh.
101  // Uses read-option READ_IF_PRESENT
102  explicit polyTopoChanger(polyMesh& mesh);
103 
104 
105  //- Destructor
106  virtual ~polyTopoChanger() = default;
107 
108 
109  // Member functions
110 
111  //- Return the mesh reference
112  const polyMesh& mesh() const
113  {
114  return mesh_;
115  }
116 
117  //- Return a list of patch types
118  wordList types() const;
119 
120  //- Return a list of patch names
121  wordList names() const;
122 
123  //- Is topology change required
124  bool changeTopology() const;
125 
126  //- Return topology change request
128 
129  //- Modify point motion
130  void modifyMotionPoints(pointField&) const;
131 
133  (
134  const bool inflate,
135  const bool syncParallel = true,
136  const bool orderCells = false,
137  const bool orderPoints = false
138  );
139 
140  //- Force recalculation of locally stored data on topological change
141  void update(const mapPolyMesh& m);
142 
143  //- Add given set of topology modifiers to the topoChanger
145 
146  //- Find modifier given a name
147  label findModifierID(const word& modName) const;
148 
149 
150  //- writeData member function required by regIOobject
151  bool writeData(Ostream&) const;
152 
153 
154  // Member Operators
155 
156  bool operator!=(const polyTopoChanger&) const;
157  bool operator==(const polyTopoChanger&) const;
158 
159 
160  // Ostream Operator
161 
162  friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
regIOobject.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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:302
Foam::polyTopoChanger
List of mesh modifiers defining the mesh dynamics.
Definition: polyTopoChanger.H:62
Foam::polyTopoChanger::operator<<
friend Ostream & operator<<(Ostream &, const polyTopoChanger &)
Foam::polyTopoChanger::changeTopology
bool changeTopology() const
Is topology change required.
Definition: polyTopoChanger.C:149
Foam::polyTopoChanger::topoChangeRequest
autoPtr< polyTopoChange > topoChangeRequest() const
Return topology change request.
Definition: polyTopoChanger.C:195
Foam::polyTopoChanger::update
void update(const mapPolyMesh &m)
Force recalculation of locally stored data on topological change.
Definition: polyTopoChanger.C:229
Foam::polyTopoChanger::names
wordList names() const
Return a list of patch names.
Definition: polyTopoChanger.C:143
Foam::polyTopoChanger::addTopologyModifiers
void addTopologyModifiers(const List< polyMeshModifier * > &tm)
Add given set of topology modifiers to the topoChanger.
Definition: polyTopoChanger.C:279
Foam::polyTopoChanger::~polyTopoChanger
virtual ~polyTopoChanger()=default
Destructor.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::polyTopoChanger::modifyMotionPoints
void modifyMotionPoints(pointField &) const
Modify point motion.
Definition: polyTopoChanger.C:215
Foam::polyTopoChanger::types
wordList types() const
Return a list of patch types.
Definition: polyTopoChanger.C:137
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::polyTopoChanger::operator!=
bool operator!=(const polyTopoChanger &) const
Definition: polyTopoChanger.C:337
Foam::polyTopoChanger::mesh_
polyMesh & mesh_
Reference to mesh.
Definition: polyTopoChanger.H:83
Foam::Field< vector >
Foam::polyTopoChanger::writeData
bool writeData(Ostream &) const
writeData member function required by regIOobject
Definition: polyTopoChanger.C:328
Foam::polyTopoChanger::changeMesh
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Definition: polyTopoChanger.C:248
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:73
Foam::polyTopoChanger::operator==
bool operator==(const polyTopoChanger &) const
Definition: polyTopoChanger.C:343
Foam::polyTopoChanger::mesh
const polyMesh & mesh() const
Return the mesh reference.
Definition: polyTopoChanger.H:111
Foam::List< word >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
PtrList.H
Foam::IOobject::readOption
readOption
Enumeration defining the read options.
Definition: IOobject.H:183
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
polyMeshModifier.H