dynamicFvMesh.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-2017 OpenFOAM Foundation
9 Copyright (C) 2018-2020 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::dynamicFvMesh
29
30Description
31 Abstract base class for geometry and/or topology changing fvMesh.
32
33 Supports optional update controls that may be used by custom solvers:
34 \table
35 Property | Description | Required | Default
36 updateControl | See time controls below | no | timeStep
37 updateInterval | Steps/time between update phases | no | 1
38 \endtable
39
40See also
41 Foam::timeControl
42
43SourceFiles
44 dynamicFvMesh.C
45 dynamicFvMeshNew.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef dynamicFvMesh_H
50#define dynamicFvMesh_H
51
52#include "fvMesh.H"
53#include "timeControl.H"
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60/*---------------------------------------------------------------------------*\
61 Class dynamicFvMesh Declaration
62\*---------------------------------------------------------------------------*/
63
64class dynamicFvMesh
65:
66 public fvMesh
67{
68 // Private Data
69
70 //- Optional update control
71 timeControl timeControl_;
72
73
74 // Private Member Functions
75
76 //- Read the updateControl/updateInterval from dynamicMeshDict
77 void readDict();
79 //- No copy construct
80 dynamicFvMesh(const dynamicFvMesh&) = delete;
81
82 //- No copy assignment
83 void operator=(const dynamicFvMesh&) = delete;
84
85
86public:
87
88 //- Runtime type information
89 TypeName("dynamicFvMesh");
90
91
92 // Declare run-time constructor selection table
93
95 (
96 autoPtr,
99 (const IOobject& io),
100 (io)
101 );
102
104 (
105 autoPtr,
107 doInit,
109 const IOobject& io,
110 const bool doInit
111 ),
112 (io, doInit)
113 );
114
115
116 // Constructors
118 //- Construct from IOobject
119 explicit dynamicFvMesh(const IOobject& io, const bool doInit=true);
120
121 //- Construct from IOobject or as zero-sized mesh
122 // Boundary is added using addFvPatches() member function
123 dynamicFvMesh(const IOobject& io, const Foam::zero, bool syncPar=true);
124
125 //- Construct from components without boundary.
126 // Boundary is added using addFvPatches() member function
128 (
129 const IOobject& io,
131 faceList&& faces,
132 labelList&& allOwner,
133 labelList&& allNeighbour,
134 const bool syncPar = true
135 );
136
137 //- Construct without boundary from cells rather than owner/neighbour.
138 // Boundary is added using addPatches() member function
140 (
141 const IOobject& io,
143 faceList&& faces,
144 cellList&& cells,
145 const bool syncPar = true
146 );
147
148
149 // Selectors
150
151 //- Select, construct and return the dynamicFvMesh
152 // If the constant/dynamicMeshDict does not exist
153 // a staticFvMesh is returned
154 static autoPtr<dynamicFvMesh> New(const IOobject& io);
155
156
157 //- Select, construct and return the dynamicFvMesh
158 // If the constant/dynamicMeshDict does not exist
159 // a staticFvMesh is returned
161 (
162 const argList& args,
163 const Time& runTime
164 );
165
166
167 //- Destructor
168 virtual ~dynamicFvMesh() = default;
169
170
171 // Member Functions
172
173 //- Initialise all non-demand-driven data
174 virtual bool init(const bool doInit);
175
176 //- Is mesh dynamic
177 virtual bool dynamic() const
178 {
179 return true;
180 }
181
182 //- Update the mesh if controller permits
183 virtual bool controlledUpdate();
184
185 //- Update the mesh for both mesh motion and topology change
186 virtual bool update() = 0;
187};
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191} // End namespace Foam
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195#endif
196
197// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:124
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:81
virtual ~dynamicFvMesh()=default
Destructor.
virtual bool dynamic() const
Is mesh dynamic.
virtual bool controlledUpdate()
Update the mesh if controller permits.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
Definition: dynamicFvMesh.C:91
static autoPtr< dynamicFvMesh > New(const IOobject &io)
Select, construct and return the dynamicFvMesh.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
declareRunTimeSelectionTable(autoPtr, dynamicFvMesh, IOobject,(const IOobject &io),(io))
declareRunTimeSelectionTable(autoPtr, dynamicFvMesh, doInit,(const IOobject &io, const bool doInit),(io, doInit))
TypeName("dynamicFvMesh")
Runtime type information.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1108
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1083
const cellList & cells() const
General time dependent execution controller. The execution parameters are given by the "Control" and ...
Definition: timeControl.H:62
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
engineTime & runTime
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
Foam::argList args(argc, argv)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73