meshObjects.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) 2022 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::meshObjects
26 
27 Description
28  Templated abstract base-class for optional mesh objects used to automate
29  their allocation to the mesh database and the mesh-modifier event-loop.
30 
31  MeshObject is templated on the type of mesh it is allocated to, the type of
32  the mesh object (TopologicalMeshObject, GeometricMeshObject,
33  MoveableMeshObject, DistributeableMeshObject, UpdateableMeshObject) and the
34  type of the actual object it is created for example:
35 
36  \verbatim
37  class leastSquaresVectors
38  :
39  public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors>
40  {
41  .
42  .
43  .
44  //- Delete the least square vectors when the mesh moves
45  virtual bool movePoints();
46  };
47  \endverbatim
48 
49  MeshObject types:
50 
51  - TopologicalMeshObject: mesh object to be deleted on topology change
52  - GeometricMeshObject: mesh object to be deleted on geometry change
53  - MoveableMeshObject: mesh object to be updated in movePoints
54  - UpdateableMeshObject: mesh object to be updated in topoChange or
55  movePoints
56  - PatchMeshObject: mesh object to be additionally updated patch changes
57 
58  Note:
59  movePoints must be provided for MeshObjects of type MoveableMeshObject
60  and both movePoints and topoChange functions must exist, provided for
61  MeshObjects of type UpdateableMeshObject.
62 
63 SourceFiles
64  meshObject.C
65  meshObjects.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef meshObjects_H
70 #define meshObjects_H
71 
72 #include "objectRegistry.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 // Forward declarations
80 class polyTopoChangeMap;
81 class polyMeshMap;
82 class polyDistributionMap;
83 
84 /*---------------------------------------------------------------------------*\
85  Class meshObjects Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class meshObjects
89 {
90 private:
91 
92  //- Checkout and delete object if owned by registry
93  // otherwise error
94  template<class Mesh>
95  static void Delete(regIOobject&);
96 
97 
98 public:
99 
100  ClassName("meshObjects");
101 
102  template<class Mesh>
103  static void movePoints(objectRegistry&);
104 
105  template<class Mesh>
106  static void topoChange(objectRegistry&, const polyTopoChangeMap&);
107 
108  template<class Mesh>
109  static void mapMesh(objectRegistry&, const polyMeshMap&);
110 
111  template<class Mesh>
112  static void distribute(objectRegistry&, const polyDistributionMap&);
113 
114  template<class Mesh>
115  static void addPatch(objectRegistry&, const label patchi);
116 
117  template<class Mesh>
118  static void reorderPatches
119  (
121  const labelUList& newToOld,
122  const bool validBoundary
123  );
124 
125  template<class Mesh, template<class> class MeshObjectType>
126  static void clear(objectRegistry&);
127 
128  //- Clear all meshObjects derived from FromType up to (but not including)
129  // ToType. Used to clear e.g. all non-updateable meshObjects
130  template
131  <
132  class Mesh,
133  template<class> class FromType,
134  template<class> class ToType
135  >
136  static void clearUpto(objectRegistry&);
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #ifdef NoRepository
147  #include "meshObjectsTemplates.C"
148 #endif
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: meshObjects.H:88
static void clearUpto(objectRegistry &)
Clear all meshObjects derived from FromType up to (but not including)
static void movePoints(objectRegistry &)
ClassName("meshObjects")
static void mapMesh(objectRegistry &, const polyMeshMap &)
static void clear(objectRegistry &)
static void distribute(objectRegistry &, const polyDistributionMap &)
static void addPatch(objectRegistry &, const label patchi)
static void topoChange(objectRegistry &, const polyTopoChangeMap &)
static void reorderPatches(objectRegistry &, const labelUList &newToOld, const bool validBoundary)
Registry of regIOobjects.
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.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
label patchi
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59