fvMeshMover.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-2026 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::fvMeshMover
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  fvMeshMover.C
35  fvMeshMoverNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef fvMeshMover_H
40 #define fvMeshMover_H
41 
42 #include "fvMesh.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvMeshMover Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fvMeshMover
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("fvMeshMover");
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  // Constructors
80 
81  //- Construct from fvMesh
82  explicit fvMeshMover(fvMesh&);
83 
84  //- Disallow default bitwise copy construction
85  fvMeshMover(const fvMeshMover&) = delete;
86 
87 
88  // Selectors
89 
90  //- Select, construct and return the fvMeshMover
91  // If the constant/dynamicMeshDict does not exist
92  // a staticFvMesh is returned
94 
95 
96  //- Destructor
97  virtual ~fvMeshMover();
98 
99 
100  // Member Functions
101 
102  //- Return the fvMesh
103  fvMesh& mesh()
104  {
105  return mesh_;
106  }
107 
108  //- Return the fvMesh
109  const fvMesh& mesh() const
110  {
111  return mesh_;
112  }
113 
114  //- Is mesh dynamic, i.e. might it change?
115  // Defaults to true, set to false in the fvMeshMovers::none
116  virtual bool dynamic() const
117  {
118  return true;
119  }
120 
121  //- Is the motion solid body? I.e., are the volumes and area magnitudes
122  // unchanged? Defaults to false. Set to true by fvMeshMovers::none and
123  // delegated to the motion solver by fvMeshMovers::pointMeshMover.
124  virtual bool solidBodyMotion() const
125  {
126  return false;
127  }
128 
129  //- Update the mesh for both mesh motion and topology change
130  virtual bool update() = 0;
131 
132  //- Update local data for topology changes
133  virtual void topoChange(const polyTopoChangeMap&) = 0;
134 
135  //- Update from another mesh using the given map
136  virtual void mapMesh(const polyMeshMap&) = 0;
137 
138  //- Update corresponding to the given distribution map
139  virtual void distribute(const polyDistributionMap&) = 0;
140 
141  //- Write the mover state
142  virtual bool write(const bool write = true) const
143  {
144  return true;
145  }
146 
147 
148  // Member Operators
149 
150  //- Disallow default bitwise assignment
151  void operator=(const fvMeshMover&) = delete;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
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
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
void operator=(const fvMeshMover &)=delete
Disallow default bitwise assignment.
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?
Definition: fvMeshMover.H:115
TypeName("fvMeshMover")
Runtime type information.
virtual bool solidBodyMotion() const
Is the motion solid body? I.e., are the volumes and area magnitudes.
Definition: fvMeshMover.H:123
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:102
declareRunTimeSelectionTable(autoPtr, fvMeshMover, fvMesh,(fvMesh &mesh, const dictionary &dict),(mesh, dict))
fvMeshMover(fvMesh &)
Construct from fvMesh.
Definition: fvMeshMover.C:40
static autoPtr< fvMeshMover > New(fvMesh &)
Select, construct and return the fvMeshMover.
virtual ~fvMeshMover()
Destructor.
Definition: fvMeshMover.C:48
virtual bool write(const bool write=true) const
Write the mover state.
Definition: fvMeshMover.H:141
virtual void topoChange(const polyTopoChangeMap &)=0
Update local data for topology changes.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
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