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-2023 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  // Permanent data
56 
57  //- Boundary mesh
58  pointBoundaryMesh boundary_;
59 
60 
61 protected:
62 
63  friend class DemandDrivenMeshObject
64  <
65  polyMesh,
67  pointMesh
68  >;
69 
70  // Protected Constructors
71 
72  //- Construct from polyMesh
73  explicit pointMesh(const polyMesh& pMesh);
74 
75 
76 public:
77 
78  // Public Typedefs
79 
80  //- Mesh type
81  typedef pointMesh Mesh;
82 
83  //- Boundary mesh type
85 
86  //- Field source type
87  template<class Type>
89 
90 
91  // Declare name of the class and its debug switch
92  ClassName("pointMesh");
93 
94 
95  // Static data
96 
97  //- Set of names of registered geometric fields
98  const static HashSet<word> geometryFields;
99 
100 
101  // Constructors
102 
103  //- Disallow default bitwise copy construction
104  pointMesh(const pointMesh&) = delete;
105 
106 
107  //- Destructor
108  ~pointMesh();
109 
110 
111  // Member Functions
112 
113  //- Return number of points
114  label size() const
115  {
116  return size(*this);
117  }
118 
119  //- Return number of points
120  static label size(const Mesh& mesh)
121  {
122  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
123  }
124 
125  //- Return reference to boundary mesh
126  const pointBoundaryMesh& boundary() const
127  {
128  return boundary_;
129  }
130 
131  //- Return parallel info
132  const globalMeshData& globalData() const
133  {
134  return GeoMesh<polyMesh>::mesh_.globalData();
135  }
136 
137  //- Return database. For now is its polyMesh.
138  const objectRegistry& thisDb() const
139  {
141  }
142 
143  //- Reset pointMesh with respect to the updated polyMesh
144  // For run-time mesh replacement and mesh to mesh mapping
145  void reset();
146 
147 
148  // Mesh callbacks
149 
150  //- Move points
151  virtual bool movePoints();
152 
153  //- Update the mesh corresponding to given map
154  virtual void topoChange(const polyTopoChangeMap&);
155 
156  //- Update from another mesh using the given map
157  virtual void mapMesh(const polyMeshMap&);
158 
159  //- Redistribute or update using the given distribution map
160  virtual void distribute(const polyDistributionMap&);
161 
162  //- Reordered/removed trailing patches. If validBoundary call is
163  // parallel synced and all add the same patch with same settings
164  virtual void reorderPatches
165  (
166  const labelUList& newToOld,
167  const bool validBoundary
168  );
169 
170  //- Inserted patch at patchi
171  virtual void addPatch(const label patchi);
172 
173 
174  // Member Operators
175 
176  //- Disallow default bitwise assignment
177  void operator=(const pointMesh&) = delete;
178 
179  bool operator!=(const pointMesh& pm) const
180  {
181  return &pm != this;
182  }
183 
184  bool operator==(const pointMesh& pm) const
185  {
186  return &pm == this;
187  }
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
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:77
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:77
pointMesh(const polyMesh &pMesh)
Construct from polyMesh.
Definition: pointMesh.C:44
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:131
virtual void topoChange(const polyTopoChangeMap &)
Update the mesh corresponding to given map.
Definition: pointMesh.C:91
ClassName("pointMesh")
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:137
pointBoundaryMesh BoundaryMesh
Boundary mesh type.
Definition: pointMesh.H:83
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:97
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: pointMesh.C:103
label size() const
Return number of points.
Definition: pointMesh.H:113
~pointMesh()
Destructor.
Definition: pointMesh.C:64
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:125
void reset()
Reset pointMesh with respect to the updated polyMesh.
Definition: pointMesh.C:190
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reordered/removed trailing patches. If validBoundary call is.
Definition: pointMesh.C:128
void operator=(const pointMesh &)=delete
Disallow default bitwise assignment.
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:183
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:178
pointMesh Mesh
Mesh type.
Definition: pointMesh.H:80
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