OpenFOAM
v2406
The open source CFD toolbox
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
-------------------------------------------------------------------------------
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::dynamicFvMesh
29
30
Description
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
40
See also
41
Foam::timeControl
42
43
SourceFiles
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
57
namespace
Foam
58
{
59
60
/*---------------------------------------------------------------------------*\
61
Class dynamicFvMesh Declaration
62
\*---------------------------------------------------------------------------*/
63
64
class
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();
78
79
//- No copy construct
80
dynamicFvMesh
(
const
dynamicFvMesh
&) =
delete
;
81
82
//- No copy assignment
83
void
operator=(
const
dynamicFvMesh
&) =
delete
;
84
85
86
public
:
87
88
//- Runtime type information
89
TypeName
(
"dynamicFvMesh"
);
90
91
92
// Declare run-time constructor selection table
93
94
declareRunTimeSelectionTable
95
(
96
autoPtr
,
97
dynamicFvMesh
,
98
IOobject
,
99
(
const
IOobject
&
io
),
100
(
io
)
101
);
102
103
declareRunTimeSelectionTable
104
(
105
autoPtr
,
106
dynamicFvMesh
,
107
doInit,
108
(
109
const
IOobject
&
io
,
110
const
bool
doInit
111
),
112
(
io
, doInit)
113
);
114
115
116
// Constructors
117
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
127
dynamicFvMesh
128
(
129
const
IOobject
&
io
,
130
pointField
&&
points
,
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
139
dynamicFvMesh
140
(
141
const
IOobject
&
io
,
142
pointField
&&
points
,
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
160
static
autoPtr<dynamicFvMesh>
New
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
// ************************************************************************* //
Foam::List< face >
Foam::dynamicFvMesh::dynamic
virtual bool dynamic() const
Is mesh dynamic.
Definition:
dynamicFvMesh.H:220
fvMesh.H
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
Foam::dynamicFvMesh::init
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
Definition:
dynamicFvMesh.C:84
Foam::primitiveMesh::cells
const cellList & cells() const
Definition:
primitiveMeshCells.C:131
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition:
Time.H:69
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition:
polyMesh.C:1078
Foam::Field< vector >
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters. ...
Definition:
argList.H:118
timeControl.H
Foam::dynamicFvMesh::TypeName
TypeName("dynamicFvMesh")
Runtime type information.
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition:
polyMesh.C:1103
Foam::dynamicFvMesh::update
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
Foam::dynamicFvMesh
Abstract base class for geometry and/or topology changing fvMesh.
Definition:
dynamicFvMesh.H:74
Foam::dynamicFvMesh::~dynamicFvMesh
virtual ~dynamicFvMesh()=default
Destructor.
Foam::dynamicFvMesh::New
static autoPtr< dynamicFvMesh > New(const IOobject &io)
Select, construct and return the dynamicFvMesh.
Definition:
dynamicFvMeshNew.C:28
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition:
zero.H:57
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition:
HashPtrTable.H:48
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Foam::dynamicFvMesh::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, dynamicFvMesh, IOobject,(const IOobject &io),(io))
args
Foam::argList args(argc, argv)
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition:
IOobject.H:180
Foam::dynamicFvMesh::controlledUpdate
virtual bool controlledUpdate()
Update the mesh if controller permits.
Definition:
dynamicFvMesh.C:160
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
src
dynamicFvMesh
dynamicFvMesh
dynamicFvMesh.H
Generated by
1.8.14