dynamicFvMesh.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "dynamicFvMesh.H"
27 #include "volFields.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(dynamicFvMesh, 0);
34  defineRunTimeSelectionTable(dynamicFvMesh, IOobject);
35 }
36 
37 
38 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
39 
40 Foam::IOobject Foam::dynamicFvMesh::dynamicMeshDictIOobject(const IOobject& io)
41 {
42  // defaultRegion (region0) gets loaded from constant, other ones get loaded
43  // from constant/<regionname>. Normally we'd use polyMesh::dbDir() but we
44  // haven't got a polyMesh yet ...
45  return IOobject
46  (
47  "dynamicMeshDict",
48  io.time().constant(),
49  (io.name() == polyMesh::defaultRegion ? "" : io.name()),
50  io.db(),
53  false
54  );
55 }
56 
57 
58 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
59 
61 :
62  fvMesh(io),
63  dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
64 {}
65 
66 
68 (
69  const IOobject& io,
71  faceList&& faces,
72  labelList&& allOwner,
73  labelList&& allNeighbour,
74  const bool syncPar
75 )
76 :
77  fvMesh
78  (
79  io,
80  move(points),
81  move(faces),
82  move(allOwner),
83  move(allNeighbour),
84  syncPar
85  ),
86  dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
87 {}
88 
89 
91 (
92  const IOobject& io,
94  faceList&& faces,
95  cellList&& cells,
96  const bool syncPar
97 )
98 :
99  fvMesh
100  (
101  io,
102  move(points),
103  move(faces),
104  move(cells),
105  syncPar
106  ),
107  dynamicMeshDict_(IOdictionary(dynamicMeshDictIOobject(io)))
108 {}
109 
110 
112 (
113  const dynamicFvMesh& mesh,
114  const dictionary& dict
115 )
116 :
117  mesh_(mesh),
118  velocityFields_(dict.lookupOrDefault("velocityFields", wordList()))
119 {}
120 
121 
122 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
123 
125 {}
126 
127 
128 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
129 
131 {
132  forAll(velocityFields_, i)
133  {
134  if (mesh_.foundObject<volVectorField>(velocityFields_[i]))
135  {
136  mesh_.lookupObjectRef<volVectorField>
137  (
138  velocityFields_[i]
140  }
141  }
142 }
143 
144 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
rDeltaT correctBoundaryConditions()
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:309
const cellList & cells() const
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1131
virtual ~dynamicFvMesh()
Destructor.
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1156
velocityMotionCorrection(const dynamicFvMesh &mesh, const dictionary &dict)
IOdictionary(const IOobject &io, const word &wantedType)
Construct given an IOobject, supply wanted typeName.
Definition: IOdictionary.C:47
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
fvMesh(const IOobject &io)
Construct from IOobject.
Definition: fvMesh.C:256
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
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
dynamicFvMesh(const IOobject &io)
Construct from objectRegistry, and read/write options.
Definition: dynamicFvMesh.C:60
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.