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-2024 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 
61 public:
62 
63  //- Runtime type information
64  TypeName("fvMeshDistributor");
65 
66 
67  // Declare run-time constructor selection table
68 
70  (
71  autoPtr,
73  fvMesh,
74  (fvMesh& mesh, const dictionary& dict),
75  (mesh, dict)
76  );
77 
78 
79  //- Helper class to update the velocity boundary conditions
80  // following mesh motion
82  {
83  // Private Data
84 
85  const fvMesh& mesh_;
86 
87  wordList velocityFields_;
88 
89  public:
90 
91  // Constructors
92 
94  (
95  const fvMesh& mesh,
96  const dictionary& dict
97  );
98 
99 
100  // Member Functions
101 
102  void update() const;
103  };
104 
105 
106  // Constructors
107 
108  //- Construct from fvMesh
109  explicit fvMeshDistributor(fvMesh&);
110 
111  //- Disallow default bitwise copy construction
112  fvMeshDistributor(const fvMeshDistributor&) = delete;
113 
114 
115  // Selectors
116 
117  //- Select, construct and return the fvMeshDistributor
118  // If the constant/dynamicMeshDict does not exist
119  // a staticFvMesh is returned
121 
122 
123  //- Destructor
124  virtual ~fvMeshDistributor();
125 
126 
127  // Member Functions
128 
129  //- Return the fvMesh
130  fvMesh& mesh()
131  {
132  return mesh_;
133  }
134 
135  //- Return the fvMesh
136  const fvMesh& mesh() const
137  {
138  return mesh_;
139  }
140 
141  //- Is mesh dynamic, i.e. might it change?
142  // Defaults to true, set to false in the fvMeshDistributors::none
143  virtual bool dynamic() const
144  {
145  return true;
146  }
147 
148  //- Update the mesh
149  virtual bool update() = 0;
150 
151  //- Update corresponding to the given map
152  virtual void topoChange(const polyTopoChangeMap&) = 0;
153 
154  //- Update from another mesh using the given map
155  virtual void mapMesh(const polyMeshMap&) = 0;
156 
157  //- Update corresponding to the given distribution map
158  virtual void distribute(const polyDistributionMap&) = 0;
159 
160  //- Write the mover state
161  virtual bool write(const bool write = true) const
162  {
163  return true;
164  }
165 
166 
167  // Member Operators
168 
169  //- Disallow default bitwise assignment
170  void operator=(const fvMeshDistributor&) = delete;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
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.
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.
virtual bool update()=0
Update the mesh.
fvMesh & mesh()
Return the fvMesh.
static autoPtr< fvMeshDistributor > New(fvMesh &)
Select, construct and return the fvMeshDistributor.
declareRunTimeSelectionTable(autoPtr, fvMeshDistributor, fvMesh,(fvMesh &mesh, const dictionary &dict),(mesh, dict))
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:96
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.
dictionary dict