fvMeshTopoChanger.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::fvMeshTopoChanger
26 
27 Description
28  Abstract base class for fvMesh topology changers.
29 
30  These classes apply topology changes to the mesh,
31  e.g. refinement/unrefinement, layer addition/removal, mesh-to-mesh mapping
32  etc.
33 
34 SourceFiles
35  fvMeshTopoChanger.C
36  fvMeshTopoChangerNew.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef fvMeshTopoChanger_H
41 #define fvMeshTopoChanger_H
42 
43 #include "fvMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class fvMeshTopoChanger Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private Data
57 
58  //- Non-const fvMesh reference to allow update
59  fvMesh& mesh_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("fvMeshTopoChanger");
66 
67 
68  // Declare run-time constructor selection table
69 
71  (
72  autoPtr,
74  fvMesh,
75  (fvMesh& mesh, const dictionary& dict),
76  (mesh, dict)
77  );
78 
79 
80  //- Helper class to update the velocity boundary conditions
81  // following mesh motion
83  {
84  // Private Data
85 
86  const fvMesh& mesh_;
87 
88  wordList velocityFields_;
89 
90  public:
91 
92  // Constructors
93 
95  (
96  const fvMesh& mesh,
97  const dictionary& dict
98  );
99 
100 
101  // Member Functions
102 
103  void update() const;
104  };
105 
106 
107  // Constructors
108 
109  //- Construct from fvMesh
110  explicit fvMeshTopoChanger(fvMesh&);
111 
112  //- Disallow default bitwise copy construction
113  fvMeshTopoChanger(const fvMeshTopoChanger&) = delete;
114 
115 
116  // Selectors
117 
118  //- Select, construct and return the fvMeshTopoChanger
120 
121  //- Select, construct and return the fvMeshTopoChanger
123 
124 
125  //- Destructor
126  virtual ~fvMeshTopoChanger();
127 
128 
129  // Member Functions
130 
131  //- Return the fvMesh
132  fvMesh& mesh()
133  {
134  return mesh_;
135  }
136 
137  //- Return the fvMesh
138  const fvMesh& mesh() const
139  {
140  return mesh_;
141  }
142 
143  //- Is mesh dynamic, i.e. might it change?
144  // Defaults to true, set to false in the fvMeshTopoChangers::none
145  virtual bool dynamic() const
146  {
147  return true;
148  }
149 
150  //- Update the mesh for both mesh motion and topology change
151  virtual bool update() = 0;
152 
153  //- Update corresponding to the given map
154  virtual void topoChange(const polyTopoChangeMap&) = 0;
155 
156  //- Update from another mesh using the given map
157  virtual void mapMesh(const polyMeshMap&) = 0;
158 
159  //- Update corresponding to the given distribution map
160  virtual void distribute(const polyDistributionMap&) = 0;
161 
162  //- Write the mover state
163  virtual bool write(const bool write = true) const
164  {
165  return true;
166  }
167 
168 
169  // Member Operators
170 
171  //- Disallow default bitwise assignment
172  void operator=(const fvMeshTopoChanger&) = delete;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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 topology changers.
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
virtual void distribute(const polyDistributionMap &)=0
Update corresponding to the given distribution map.
TypeName("fvMeshTopoChanger")
Runtime type information.
void operator=(const fvMeshTopoChanger &)=delete
Disallow default bitwise assignment.
virtual bool dynamic() const
Is mesh dynamic, i.e. might it change?
virtual ~fvMeshTopoChanger()
Destructor.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
fvMesh & mesh()
Return the fvMesh.
fvMeshTopoChanger(fvMesh &)
Construct from fvMesh.
declareRunTimeSelectionTable(autoPtr, fvMeshTopoChanger, fvMesh,(fvMesh &mesh, const dictionary &dict),(mesh, dict))
static autoPtr< fvMeshTopoChanger > New(fvMesh &, const dictionary &dict)
Select, construct and return the fvMeshTopoChanger.
virtual bool write(const bool write=true) const
Write the mover state.
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