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-2019 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 
95  (
96  autoPtr,
98  IOobject,
99  (const IOobject& io),
100  (io)
101  );
102 
103 
104  // Constructors
105 
106  //- Construct from an IOobject
107  explicit dynamicFvMesh(const IOobject& io);
108 
109  //- Construct from components without boundary.
110  // Boundary is added using addFvPatches() member function
111  dynamicFvMesh(const IOobject& io, const zero, const bool syncPar=true);
112 
113  //- Construct from components without boundary.
114  // Boundary is added using addFvPatches() member function
116  (
117  const IOobject& io,
118  pointField&& points,
119  faceList&& faces,
120  labelList&& allOwner,
121  labelList&& allNeighbour,
122  const bool syncPar = true
123  );
124 
125  //- Construct without boundary from cells rather than owner/neighbour.
126  // Boundary is added using addPatches() member function
128  (
129  const IOobject& io,
130  pointField&& points,
131  faceList&& faces,
132  cellList&& cells,
133  const bool syncPar = true
134  );
135 
136 
137  // Selectors
138 
139  //- Select, construct and return the dynamicFvMesh
140  // If the constant/dynamicMeshDict does not exist
141  // a staticFvMesh is returned
142  static autoPtr<dynamicFvMesh> New(const IOobject& io);
143 
144 
145  //- Select, construct and return the dynamicFvMesh
146  // If the constant/dynamicMeshDict does not exist
147  // a staticFvMesh is returned
149  (
150  const argList& args,
151  const Time& runTime
152  );
153 
154 
155  //- Destructor
156  virtual ~dynamicFvMesh() = default;
157 
158 
159  // Member Functions
160 
161  //- Is mesh dynamic
162  virtual bool dynamic() const
163  {
164  return true;
165  }
166 
167  //- Update the mesh if controller permits
168  virtual bool controlledUpdate();
169 
170  //- Update the mesh for both mesh motion and topology change
171  virtual bool update() = 0;
172 };
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
Foam::dynamicFvMesh::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, dynamicFvMesh, IOobject,(const IOobject &io),(io))
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1038
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::dynamicFvMesh::New
static autoPtr< dynamicFvMesh > New(const IOobject &io)
Select, construct and return the dynamicFvMesh.
Definition: dynamicFvMeshNew.C:35
Foam::dynamicFvMesh::update
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
Foam::dynamicFvMesh::~dynamicFvMesh
virtual ~dynamicFvMesh()=default
Destructor.
Foam::primitiveMesh::cells
const cellList & cells() const
Definition: primitiveMeshCells.C:138
Foam::dynamicFvMesh
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:78
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:123
Foam::dynamicFvMesh::dynamic
virtual bool dynamic() const
Is mesh dynamic.
Definition: dynamicFvMesh.H:176
timeControl.H
Foam::Field< vector >
Foam::timeControl
General time dependent execution controller. The execution parameters are given by the "Control" and ...
Definition: timeControl.H:61
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dynamicFvMesh::controlledUpdate
virtual bool controlledUpdate()
Update the mesh if controller permits.
Definition: dynamicFvMesh.C:148
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1063
Foam::List< face >
Foam::dynamicFvMesh::TypeName
TypeName("dynamicFvMesh")
Runtime type information.
args
Foam::argList args(argc, argv)
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61