fvMeshDistributor.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) 2021-2023 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::fvMeshDistributor
26 
27 Description
28  Abstract base class for fvMesh movers.
29 
30  These classes move the mesh points, update the cell volumes and generate
31  the corresponding mesh fluxes without any topology change.
32 
33 SourceFiles
34  fvMeshDistributor.C
35  fvMeshDistributorNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef fvMeshDistributor_H
40 #define fvMeshDistributor_H
41 
42 #include "fvMesh.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvMeshDistributor Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- Non-const fvMesh reference to allow update
58  fvMesh& mesh_;
59 
60  //- The dynamicMeshDict
61  dictionary dynamicMeshDict_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("fvMeshDistributor");
68 
69 
70  // Declare run-time constructor selection table
71 
73  (
74  autoPtr,
76  fvMesh,
77  (fvMesh& mesh),
78  (mesh)
79  );
80 
81 
82  //- Helper class to update the velocity boundary conditions
83  // following mesh motion
85  {
86  // Private Data
87 
88  const fvMesh& mesh_;
89 
90  wordList velocityFields_;
91 
92  public:
93 
94  // Constructors
95 
97  (
98  const fvMesh& mesh,
99  const dictionary& dict
100  );
101 
102 
103  // Member Functions
104 
105  void update() const;
106  };
107 
108 
109  // Constructors
110 
111  //- Construct from fvMesh
112  explicit fvMeshDistributor(fvMesh&);
113 
114  //- Disallow default bitwise copy construction
115  fvMeshDistributor(const fvMeshDistributor&) = delete;
116 
117 
118  // Selectors
119 
120  //- Select, construct and return the fvMeshDistributor
121  // If the constant/dynamicMeshDict does not exist
122  // a staticFvMesh is returned
124 
125 
126  //- Destructor
127  virtual ~fvMeshDistributor();
128 
129 
130  // Member Functions
131 
132  //- Return the fvMesh
133  fvMesh& mesh()
134  {
135  return mesh_;
136  }
137 
138  //- Return the fvMesh
139  const fvMesh& mesh() const
140  {
141  return mesh_;
142  }
143 
144  //- Return the dynamicMeshDict/distributor sub-dict
145  const dictionary& dict() const
146  {
147  return dynamicMeshDict_.subDict("distributor");
148  }
149 
150  //- Is mesh dynamic, i.e. might it change?
151  // Defaults to true, set to false in the fvMeshDistributors::none
152  virtual bool dynamic() const
153  {
154  return true;
155  }
156 
157  //- Update the mesh
158  virtual bool update() = 0;
159 
160  //- Update corresponding to the given map
161  virtual void topoChange(const polyTopoChangeMap&) = 0;
162 
163  //- Update from another mesh using the given map
164  virtual void mapMesh(const polyMeshMap&) = 0;
165 
166  //- Update corresponding to the given distribution map
167  virtual void distribute(const polyDistributionMap&) = 0;
168 
169  //- Write the mover state
170  virtual bool write(const bool write = true) const
171  {
172  return true;
173  }
174 
175 
176  // Member Operators
177 
178  //- Disallow default bitwise assignment
179  void operator=(const fvMeshDistributor&) = delete;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:843
Helper class to update the velocity boundary conditions.
velocityMotionCorrection(const fvMesh &mesh, const dictionary &dict)
Abstract base class for fvMesh movers.
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
void operator=(const fvMeshDistributor &)=delete
Disallow default bitwise assignment.
const dictionary & dict() const
Return the dynamicMeshDict/distributor sub-dict.
TypeName("fvMeshDistributor")
Runtime type information.
virtual void distribute(const polyDistributionMap &)=0
Update corresponding to the given distribution map.
virtual bool dynamic() const
Is mesh dynamic, i.e. might it change?
virtual ~fvMeshDistributor()
Destructor.
declareRunTimeSelectionTable(autoPtr, fvMeshDistributor, fvMesh,(fvMesh &mesh),(mesh))
virtual bool update()=0
Update the mesh.
fvMesh & mesh()
Return the fvMesh.
static autoPtr< fvMeshDistributor > New(fvMesh &)
Select, construct and return the fvMeshDistributor.
virtual bool write(const bool write=true) const
Write the mover state.
fvMeshDistributor(fvMesh &)
Construct from fvMesh.
virtual void topoChange(const polyTopoChangeMap &)=0
Update corresponding to the given map.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.