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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::polyTopoChanger
29
30Description
31 List of mesh modifiers defining the mesh dynamics.
32
33SourceFiles
34 polyTopoChanger.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_polyTopoChanger_H
39#define Foam_polyTopoChanger_H
40
41#include "regIOobject.H"
42#include "PtrList.H"
43#include "polyMeshModifier.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class polyMesh;
52class mapPolyMesh;
53class polyBoundaryMesh;
54class polyTopoChanger;
55
56Ostream& operator<<(Ostream&, const polyTopoChanger&);
57
58
59/*---------------------------------------------------------------------------*\
60 Class polyTopoChanger Declaration
61\*---------------------------------------------------------------------------*/
64:
65 public PtrList<polyMeshModifier>,
66 public regIOobject
67{
68 // Private Member Functions
69
70 //- Read if IOobject flags set, set modifiers. Return true if read.
71 bool readContents();
72
73 //- No copy construct
74 polyTopoChanger(const polyTopoChanger&) = delete;
75
76 //- No copy assignment
77 void operator=(const polyTopoChanger&) = delete;
78
79
80protected:
81
82 // Protected data
83
84 //- Reference to mesh
86
87public:
88
89 //- Runtime type information
90 TypeName("polyTopoChanger");
91
92
93 // Constructors
94
95 //- Read construct given IOobject and a polyMesh
97
98 //- Read construct for given polyMesh and read-option
100
101 //- Read construct for given polyMesh.
102 // Uses read-option READ_IF_PRESENT
103 explicit polyTopoChanger(polyMesh& mesh);
104
105
106 //- Destructor
107 virtual ~polyTopoChanger() = default;
108
109
110 // Member functions
111
112 //- Return the mesh reference
113 const polyMesh& mesh() const
114 {
115 return mesh_;
116 }
117
118 //- Return a list of patch types
119 wordList types() const;
120
121 //- Return a list of patch names
122 wordList names() const;
123
124 //- Is topology change required
125 bool changeTopology() const;
126
127 //- Return topology change request
129
130 //- Modify point motion
131 void modifyMotionPoints(pointField&) const;
132
134 (
135 const bool inflate,
136 const bool syncParallel = true,
137 const bool orderCells = false,
138 const bool orderPoints = false
139 );
140
141 //- Force recalculation of locally stored data on topological change
142 void update(const mapPolyMesh& m);
143
144 //- Add given set of topology modifiers to the topoChanger
146
147 //- Find modifier given a name
148 label findModifierID(const word& modName) const;
149
150
151 //- writeData member function required by regIOobject
152 bool writeData(Ostream&) const;
153
154
155 // Member Operators
156
157 bool operator!=(const polyTopoChanger&) const;
158 bool operator==(const polyTopoChanger&) const;
159
160
161 // Ostream Operator
163 friend Ostream& operator<<(Ostream&, const polyTopoChanger&);
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
readOption
Enumeration defining the read options.
Definition: IOobject.H:177
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
List of mesh modifiers defining the mesh dynamics.
bool operator==(const polyTopoChanger &) const
TypeName("polyTopoChanger")
Runtime type information.
bool writeData(Ostream &) const
writeData member function required by regIOobject
label findModifierID(const word &modName) const
Find modifier given a name.
autoPtr< polyTopoChange > topoChangeRequest() const
Return topology change request.
const polyMesh & mesh() const
Return the mesh reference.
void addTopologyModifiers(const List< polyMeshModifier * > &tm)
Add given set of topology modifiers to the topoChanger.
wordList types() const
Return a list of patch types.
polyMesh & mesh_
Reference to mesh.
bool changeTopology() const
Is topology change required.
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
bool operator!=(const polyTopoChanger &) const
virtual ~polyTopoChanger()=default
Destructor.
wordList names() const
Return a list of patch names.
void modifyMotionPoints(pointField &) const
Modify point motion.
friend Ostream & operator<<(Ostream &, const polyTopoChanger &)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A class for handling words, derived from Foam::string.
Definition: word.H:68
mesh update()
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73