pointMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::pointMesh
29 
30 Description
31  Mesh representing a set of points created from polyMesh.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef Foam_pointMesh_H
36 #define Foam_pointMesh_H
37 
38 #include "GeoMesh.H"
39 #include "MeshObject.H"
40 #include "polyMesh.H"
41 #include "pointBoundaryMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class pointMesh Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class pointMesh
53 :
54  public MeshObject<polyMesh, UpdateableMeshObject, pointMesh>,
55  public GeoMesh<polyMesh>
56 {
57  // Permanent Data
58 
59  //- Boundary mesh
60  pointBoundaryMesh boundary_;
61 
62 
63  // Private Member Functions
64 
65  //- Map all fields
66  void mapFields(const mapPolyMesh& mpm);
67 
68  //- No copy construct
69  pointMesh(const pointMesh&) = delete;
70 
71  //- No copy assignment
72  void operator=(const pointMesh&) = delete;
73 
74 
75 public:
76 
77  // Public Typedefs
78 
79  //- The mesh type
80  typedef pointMesh Mesh;
81 
82  //- The boundary type associated with the mesh
84 
85 
86  // Declare name of the class and its debug switch
87  ClassName("pointMesh");
88 
89 
90  // Constructors
91 
92  //- Construct from polyMesh
93  explicit pointMesh(const polyMesh& pMesh);
94 
95 
96  //- Destructor
97  ~pointMesh() = default;
98 
99 
100  // Member Functions
101 
102  //- Return size. Number of points
103  static label size(const Mesh& mesh)
104  {
105  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
106  }
107 
108  //- Return size. Number of points
109  label size() const
110  {
111  return size(*this);
112  }
113 
114  //- Return reference to boundary mesh
115  const pointBoundaryMesh& boundary() const
116  {
117  return boundary_;
118  }
119 
120  //- Return parallel info
121  const globalMeshData& globalData() const
122  {
123  return GeoMesh<polyMesh>::mesh_.globalData();
124  }
125 
126  //- Return database. For now is its polyMesh.
127  const objectRegistry& thisDb() const
128  {
130  }
131 
132  //- Return Time from polyMesh.
133  const Time& time() const
134  {
135  return GeoMesh<polyMesh>::mesh_.time();
136  }
137 
139  // Mesh motion
140 
141  //- Move points
142  bool movePoints();
143 
144  //- Update the mesh corresponding to given map
145  void updateMesh(const mapPolyMesh& mpm);
147 
148  // Member Operators
149 
150  bool operator!=(const pointMesh& pm) const
151  {
152  return &pm != this;
153  }
155  bool operator==(const pointMesh& pm) const
156  {
157  return &pm == this;
158  }
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
bool movePoints()
Move points.
Definition: pointMesh.C:86
Foam::pointBoundaryMesh.
label nPoints() const noexcept
Number of mesh points.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:180
ClassName("pointMesh")
void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: pointMesh.C:100
pointMesh Mesh
The mesh type.
Definition: pointMesh.H:83
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:45
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:175
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:84
const Time & time() const
Return Time from polyMesh.
Definition: pointMesh.H:154
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:138
~pointMesh()=default
Destructor.
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:146
label size() const
Return size. Number of points.
Definition: pointMesh.H:122
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:86
pointBoundaryMesh BoundaryMesh
The boundary type associated with the mesh.
Definition: pointMesh.H:88
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:42
Registry of regIOobjects.
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:130
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:51
Namespace for OpenFOAM.