dynamicFvMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::dynamicFvMesh
26 
27 Description
28  Abstract base class for geometry and/or topology changing fvMesh.
29 
30 SourceFiles
31  dynamicFvMesh.C
32  dynamicFvMeshNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef dynamicFvMesh_H
37 #define dynamicFvMesh_H
38 
39 #include "fvMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class dynamicFvMesh Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class dynamicFvMesh
51 :
52  public fvMesh
53 {
54  // Private Data
55 
56  //- The dynamicMeshDict
57  dictionary dynamicMeshDict_;
58 
59 
60  // Private Member Functions
61 
62  //- Return the dynamicMeshDict IOobject
63  static IOobject dynamicMeshDictIOobject(const IOobject& io);
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("dynamicFvMesh");
70 
71 
72  // Declare run-time constructor selection table
73 
75  (
76  autoPtr,
78  IOobject,
79  (const IOobject& io),
80  (io)
81  );
82 
83 
84  //- Helper class to update the velocity boundary conditions
85  // following mesh motion
87  {
88  // Private Data
89 
90  const dynamicFvMesh& mesh_;
91 
92  wordList velocityFields_;
93 
94  public:
95 
96  // Constructors
97 
99  (
100  const dynamicFvMesh& mesh,
101  const dictionary& dict
102  );
103 
104 
105  // Member Functions
106 
107  void update() const;
108  };
109 
110 
111  // Constructors
112 
113  //- Construct from objectRegistry, and read/write options
114  explicit dynamicFvMesh(const IOobject& io);
115 
116  //- Construct from components without boundary.
117  // Boundary is added using addFvPatches() member function
119  (
120  const IOobject& io,
121  pointField&& points,
122  faceList&& faces,
123  labelList&& allOwner,
124  labelList&& allNeighbour,
125  const bool syncPar = true
126  );
127 
128  //- Construct without boundary from cells rather than owner/neighbour.
129  // Boundary is added using addPatches() member function
131  (
132  const IOobject& io,
133  pointField&& points,
134  faceList&& faces,
135  cellList&& cells,
136  const bool syncPar = true
137  );
138 
139  //- Disallow default bitwise copy construction
140  dynamicFvMesh(const dynamicFvMesh&) = delete;
141 
142 
143  // Selectors
144 
145  //- Select, construct and return the dynamicFvMesh
146  // If the constant/dynamicMeshDict does not exist
147  // a staticFvMesh is returned
148  static autoPtr<dynamicFvMesh> New(const IOobject& io);
149 
150 
151  //- Destructor
152  virtual ~dynamicFvMesh();
153 
154 
155  // Member Functions
156 
157  //- Return the dynamicMeshDict
158  const dictionary& dynamicMeshDict() const
159  {
160  return dynamicMeshDict_;
161  }
162 
163  //- Is mesh dynamic
164  virtual bool dynamic() const
165  {
166  return true;
167  }
168 
169  //- Update the mesh for both mesh motion and topology change
170  virtual bool update() = 0;
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const dynamicFvMesh&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual bool dynamic() const
Is mesh dynamic.
const cellList & cells() const
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1131
virtual ~dynamicFvMesh()
Destructor.
Helper class to update the velocity boundary conditions.
Definition: dynamicFvMesh.H:85
dynamicFvMesh & mesh
TypeName("dynamicFvMesh")
Runtime type information.
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1156
velocityMotionCorrection(const dynamicFvMesh &mesh, const dictionary &dict)
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:49
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
static autoPtr< dynamicFvMesh > New(const IOobject &io)
Select, construct and return the dynamicFvMesh.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
dynamicFvMesh(const IOobject &io)
Construct from objectRegistry, and read/write options.
Definition: dynamicFvMesh.C:60
declareRunTimeSelectionTable(autoPtr, dynamicFvMesh, IOobject,(const IOobject &io),(io))
void operator=(const dynamicFvMesh &)=delete
Disallow default bitwise assignment.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.
const dictionary & dynamicMeshDict() const
Return the dynamicMeshDict.