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-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::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  // Constructors
80 
81  //- Construct from fvMesh
82  explicit fvMeshDistributor(fvMesh&);
83 
84  //- Disallow default bitwise copy construction
85  fvMeshDistributor(const fvMeshDistributor&) = delete;
86 
87 
88  // Selectors
89 
90  //- Select, construct and return the fvMeshDistributor
91  // If the constant/dynamicMeshDict does not exist
92  // a staticFvMesh is returned
94 
95 
96  //- Destructor
97  virtual ~fvMeshDistributor();
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 fvMeshDistributors::none
116  virtual bool dynamic() const
117  {
118  return true;
119  }
120 
121  //- Update the mesh
122  virtual bool update() = 0;
123 
124  //- Update corresponding to the given map
125  virtual void topoChange(const polyTopoChangeMap&) = 0;
126 
127  //- Update from another mesh using the given map
128  virtual void mapMesh(const polyMeshMap&) = 0;
129 
130  //- Update corresponding to the given distribution map
131  virtual void distribute(const polyDistributionMap&) = 0;
132 
133  //- Write the mover state
134  virtual bool write(const bool write = true) const
135  {
136  return true;
137  }
138 
139 
140  // Member Operators
141 
142  //- Disallow default bitwise assignment
143  void operator=(const fvMeshDistributor&) = delete;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
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.
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: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