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-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::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  // Constructors
81 
82  //- Construct from fvMesh
83  explicit fvMeshTopoChanger(fvMesh&);
84 
85  //- Disallow default bitwise copy construction
86  fvMeshTopoChanger(const fvMeshTopoChanger&) = delete;
87 
88 
89  // Selectors
90 
91  //- Select, construct and return the fvMeshTopoChanger
93 
94  //- Select, construct and return the fvMeshTopoChanger
96 
97 
98  //- Destructor
99  virtual ~fvMeshTopoChanger();
100 
101 
102  // Member Functions
103 
104  //- Return the fvMesh
105  fvMesh& mesh()
106  {
107  return mesh_;
108  }
109 
110  //- Return the fvMesh
111  const fvMesh& mesh() const
112  {
113  return mesh_;
114  }
115 
116  //- Is mesh dynamic, i.e. might it change?
117  // Defaults to true, set to false in the fvMeshTopoChangers::none
118  virtual bool dynamic() const
119  {
120  return true;
121  }
122 
123  //- Update the mesh for both mesh motion and topology change
124  virtual bool update() = 0;
125 
126  //- Update corresponding to the given map
127  virtual void topoChange(const polyTopoChangeMap&) = 0;
128 
129  //- Update from another mesh using the given map
130  virtual void mapMesh(const polyMeshMap&) = 0;
131 
132  //- Update corresponding to the given distribution map
133  virtual void distribute(const polyDistributionMap&) = 0;
134 
135  //- Write the mover state
136  virtual bool write(const bool write = true) const
137  {
138  return true;
139  }
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const fvMeshTopoChanger&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
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 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: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