pointMesh.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) 2011-2025 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::pointMesh
26 
27 Description
28  Mesh representing a set of points created from polyMesh.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef pointMesh_H
33 #define pointMesh_H
34 
35 #include "GeoMesh.H"
36 #include "DemandDrivenMeshObject.H"
37 #include "polyMesh.H"
38 #include "pointBoundaryMesh.H"
39 #include "pointFieldsFwd.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class pointMesh Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class pointMesh
51 :
52  public DemandDrivenMeshObject<polyMesh, RepatchableMeshObject, pointMesh>,
53  public GeoMesh<polyMesh>
54 {
55  // Private Data
56 
57  //- Boundary mesh
58  pointBoundaryMesh boundary_;
59 
60 
61 protected:
62 
63  //- Declare friendship with the base mesh object so that it can use
64  // this class' protected constructors
65  friend class DemandDrivenMeshObject
66  <
67  polyMesh,
69  pointMesh
70  >;
71 
72 
73  // Protected Constructors
74 
75  //- Construct from polyMesh
76  explicit pointMesh(const polyMesh& pMesh);
77 
78 
79 public:
80 
81  // Public Typedefs
82 
83  //- Mesh type
84  typedef pointMesh Mesh;
85 
86  //- Boundary mesh type
88 
89  //- Patch field type
90  template<class Type>
92 
93  //- Field source type
94  template<class Type>
96 
97 
98  // Declare name of the class and its debug switch
99  ClassName("pointMesh");
100 
101 
102  // Static data
103 
104  //- Set of names of registered geometric fields
105  const static HashSet<word> geometryFields;
106 
107  //- Set of names of registered current-time geometric fields
108  const static HashSet<word> curGeometryFields;
109 
110 
111  // Constructors
112 
113  //- Disallow default bitwise copy construction
114  pointMesh(const pointMesh&) = delete;
115 
116 
117  //- Destructor
118  ~pointMesh();
119 
120 
121  // Member Functions
122 
123  //- Return number of points
124  label size() const
125  {
126  return size(*this);
127  }
128 
129  //- Return number of points
130  static label size(const Mesh& mesh)
131  {
132  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
133  }
134 
135  //- Return reference to boundary mesh
136  const pointBoundaryMesh& boundary() const
137  {
138  return boundary_;
139  }
140 
141  //- Return parallel info
142  const globalMeshData& globalData() const
143  {
144  return GeoMesh<polyMesh>::mesh_.globalData();
145  }
146 
147  //- Return database. For now is its polyMesh.
148  const objectRegistry& thisDb() const
149  {
151  }
152 
153  //- Reset pointMesh with respect to the updated polyMesh
154  // For run-time mesh replacement and mesh to mesh mapping
155  void reset();
156 
157 
158  // Mesh callbacks
159 
160  //- Move points
161  virtual bool movePoints();
162 
163  //- Update the mesh corresponding to given map
164  virtual void topoChange(const polyTopoChangeMap&);
165 
166  //- Update from another mesh using the given map
167  virtual void mapMesh(const polyMeshMap&);
168 
169  //- Redistribute or update using the given distribution map
170  virtual void distribute(const polyDistributionMap&);
171 
172  //- Reordered/removed trailing patches. If validBoundary call is
173  // parallel synced and all add the same patch with same settings
174  virtual void reorderPatches
175  (
176  const labelUList& newToOld,
177  const bool validBoundary
178  );
179 
180  //- Inserted patch at patchi
181  virtual void addPatch(const label patchi);
182 
183 
184  // Member Operators
185 
186  //- Disallow default bitwise assignment
187  void operator=(const pointMesh&) = delete;
188 
189  //- Equality comparison
190  bool operator==(const pointMesh& pm) const
191  {
192  return &pm == this;
193  }
194 
195  //- Inequality comparison
196  bool operator!=(const pointMesh& pm) const
197  {
198  return &pm != this;
199  }
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:47
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:80
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:54
A HashTable with keys but without contents.
Definition: HashSet.H:62
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Registry of regIOobjects.
Foam::pointBoundaryMesh.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:53
virtual bool movePoints()
Move points.
Definition: pointMesh.C:79
static const HashSet< word > curGeometryFields
Set of names of registered current-time geometric fields.
Definition: pointMesh.H:107
pointMesh(const polyMesh &pMesh)
Construct from polyMesh.
Definition: pointMesh.C:46
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:141
virtual void topoChange(const polyTopoChangeMap &)
Update the mesh corresponding to given map.
Definition: pointMesh.C:93
ClassName("pointMesh")
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:147
pointBoundaryMesh BoundaryMesh
Boundary mesh type.
Definition: pointMesh.H:86
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: pointMesh.C:115
static const HashSet< word > geometryFields
Set of names of registered geometric fields.
Definition: pointMesh.H:104
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: pointMesh.C:104
label size() const
Return number of points.
Definition: pointMesh.H:123
~pointMesh()
Destructor.
Definition: pointMesh.C:66
virtual void addPatch(const label patchi)
Inserted patch at patchi.
Definition: pointMesh.C:151
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:135
void reset()
Reset pointMesh with respect to the updated polyMesh.
Definition: pointMesh.C:183
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reordered/removed trailing patches. If validBoundary call is.
Definition: pointMesh.C:127
void operator=(const pointMesh &)=delete
Disallow default bitwise assignment.
bool operator==(const pointMesh &pm) const
Equality comparison.
Definition: pointMesh.H:189
bool operator!=(const pointMesh &pm) const
Inequality comparison.
Definition: pointMesh.H:195
pointMesh Mesh
Mesh type.
Definition: pointMesh.H:83
Abstract base class for point-mesh patch fields.
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
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
label nPoints() const
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