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 pointMesh_H
36 #define 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  // Declare name of the class and its debug switch
78  ClassName("pointMesh");
79 
80 
81  typedef pointMesh Mesh;
83 
84 
85  // Constructors
86 
87  //- Construct from polyMesh
88  explicit pointMesh(const polyMesh& pMesh);
89 
90 
91  //- Destructor
92  ~pointMesh() = default;
93 
94 
95  // Member Functions
96 
97  //- Return size. Number of points
98  static label size(const Mesh& mesh)
99  {
100  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
101  }
102 
103  //- Return size. Number of points
104  label size() const
105  {
106  return size(*this);
107  }
108 
109  //- Return reference to boundary mesh
110  const pointBoundaryMesh& boundary() const
111  {
112  return boundary_;
113  }
114 
115  //- Return parallel info
116  const globalMeshData& globalData() const
117  {
118  return GeoMesh<polyMesh>::mesh_.globalData();
119  }
120 
121  //- Return database. For now is its polyMesh.
122  const objectRegistry& thisDb() const
123  {
125  }
126 
127  //- Return Time from polyMesh.
128  const Time& time() const
129  {
130  return GeoMesh<polyMesh>::mesh_.time();
131  }
132 
133 
134  // Mesh motion
135 
136  //- Move points
137  bool movePoints();
138 
139  //- Update the mesh corresponding to given map
140  void updateMesh(const mapPolyMesh& mpm);
141 
142 
143  // Member Operators
144 
145  bool operator!=(const pointMesh& pm) const
146  {
147  return &pm != this;
148  }
149 
150  bool operator==(const pointMesh& pm) const
151  {
152  return &pm == this;
153  }
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Foam::pointMesh::operator==
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:149
Foam::pointMesh::boundary
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:109
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::pointMesh::size
static label size(const Mesh &mesh)
Return size. Number of points.
Definition: pointMesh.H:97
Foam::pointMesh::operator!=
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:144
Foam::pointMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:115
Foam::pointMesh::time
const Time & time() const
Return Time from polyMesh.
Definition: pointMesh.H:127
Foam::GeoMesh< polyMesh >::mesh_
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:55
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::primitiveMesh::nPoints
label nPoints() const noexcept
Number of mesh points.
Definition: primitiveMeshI.H:37
pointBoundaryMesh.H
Foam::pointMesh::~pointMesh
~pointMesh()=default
Destructor.
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::mesh
const polyMesh & mesh() const
Definition: MeshObject.H:122
Foam::pointMesh::ClassName
ClassName("pointMesh")
Foam::pointMesh::Mesh
pointMesh Mesh
Definition: pointMesh.H:80
Foam::pointMesh::BoundaryMesh
pointBoundaryMesh BoundaryMesh
Definition: pointMesh.H:81
Foam::globalMeshData
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Definition: globalMeshData.H:107
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:48
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:56
Foam::pointMesh::size
label size() const
Return size. Number of points.
Definition: pointMesh.H:103
Foam::pointMesh::thisDb
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:121
MeshObject.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:88
Foam::pointMesh::movePoints
bool movePoints()
Move points.
Definition: pointMesh.C:93
Foam::GeoMesh::thisDb
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:84
GeoMesh.H
Foam::pointMesh::updateMesh
void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: pointMesh.C:107