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-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::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 "MeshObject.H"
37 #include "polyMesh.H"
38 #include "pointBoundaryMesh.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class pointMesh Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class pointMesh
50 :
51  public MeshObject<polyMesh, PatchMeshObject, pointMesh>,
52  public GeoMesh<polyMesh>
53 {
54  // Permanent data
55 
56  //- Boundary mesh
57  pointBoundaryMesh boundary_;
58 
59 
60 public:
61 
62  // Declare name of the class and its debug switch
63  ClassName("pointMesh");
64 
65 
66  typedef pointMesh Mesh;
68 
69 
70  // Constructors
71 
72  //- Construct from polyMesh
73  explicit pointMesh(const polyMesh& pMesh);
74 
75  //- Disallow default bitwise copy construction
76  pointMesh(const pointMesh&) = delete;
77 
78 
79  //- Destructor
80  ~pointMesh();
81 
82 
83  // Member Functions
84 
85  //- Return number of points
86  label size() const
87  {
88  return size(*this);
89  }
90 
91  //- Return number of points
92  static label size(const Mesh& mesh)
93  {
94  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
95  }
96 
97  //- Return reference to boundary mesh
98  const pointBoundaryMesh& boundary() const
99  {
100  return boundary_;
101  }
102 
103  //- Return parallel info
104  const globalMeshData& globalData() const
105  {
106  return GeoMesh<polyMesh>::mesh_.globalData();
107  }
108 
109  //- Return database. For now is its polyMesh.
110  const objectRegistry& thisDb() const
111  {
113  }
114 
115  //- Reset pointMesh with respect to the updated polyMesh
116  // For run-time mesh replacement and mesh to mesh mapping
117  void reset();
118 
119 
120  // Mesh callbacks
121 
122  //- Move points
123  virtual bool movePoints();
124 
125  //- Update the mesh corresponding to given map
126  virtual void topoChange(const polyTopoChangeMap&);
127 
128  //- Update from another mesh using the given map
129  virtual void mapMesh(const polyMeshMap&);
130 
131  //- Redistribute or update using the given distribution map
132  virtual void distribute(const polyDistributionMap&);
133 
134  //- Reordered/removed trailing patches. If validBoundary call is
135  // parallel synced and all add the same patch with same settings
136  virtual void reorderPatches
137  (
138  const labelUList& newToOld,
139  const bool validBoundary
140  );
141 
142  //- Inserted patch at patchi
143  virtual void addPatch(const label patchi);
144 
145 
146  // Member Operators
147 
148  //- Disallow default bitwise assignment
149  void operator=(const pointMesh&) = delete;
151  bool operator!=(const pointMesh& pm) const
152  {
153  return &pm != this;
154  }
156  bool operator==(const pointMesh& pm) const
157  {
158  return &pm == this;
159  }
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
virtual bool movePoints()
Move points.
Definition: pointMesh.C:75
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reordered/removed trailing patches. If validBoundary call is.
Definition: pointMesh.C:126
Foam::pointBoundaryMesh.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:155
ClassName("pointMesh")
virtual void addPatch(const label patchi)
Inserted patch at patchi.
Definition: pointMesh.C:149
pointMesh Mesh
Definition: pointMesh.H:65
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:150
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:87
void reset()
Reset pointMesh with respect to the updated polyMesh.
Definition: pointMesh.C:188
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:103
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:109
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: pointMesh.C:101
~pointMesh()
Destructor.
Definition: pointMesh.C:62
label size() const
Return number of points.
Definition: pointMesh.H:85
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
virtual void topoChange(const polyTopoChangeMap &)
Update the mesh corresponding to given map.
Definition: pointMesh.C:89
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:77
label patchi
pointBoundaryMesh BoundaryMesh
Definition: pointMesh.H:66
label nPoints() const
pointMesh(const polyMesh &pMesh)
Construct from polyMesh.
Definition: pointMesh.C:42
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:46
Registry of regIOobjects.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:50
GeoMesh(const MESH &mesh)
Construct from MESH.
Definition: GeoMesh.H:68
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:97
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:54
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: pointMesh.C:113
Namespace for OpenFOAM.
void operator=(const pointMesh &)=delete
Disallow default bitwise assignment.