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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pointMesh
28 
29 Description
30  Mesh representing a set of points created from polyMesh.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef pointMesh_H
35 #define pointMesh_H
36 
37 #include "GeoMesh.H"
38 #include "MeshObject.H"
39 #include "polyMesh.H"
40 #include "pointBoundaryMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class pointMesh Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class pointMesh
52 :
53  public MeshObject<polyMesh, UpdateableMeshObject, pointMesh>,
54  public GeoMesh<polyMesh>
55 {
56  // Permanent data
57 
58  //- Boundary mesh
59  pointBoundaryMesh boundary_;
60 
61 
62  // Private Member Functions
63 
64  //- Map all fields
65  void mapFields(const mapPolyMesh& mpm);
66 
67  //- No copy construct
68  pointMesh(const pointMesh&) = delete;
69 
70  //- No copy assignment
71  void operator=(const pointMesh&) = delete;
72 
73 
74 public:
75 
76  // Declare name of the class and its debug switch
77  ClassName("pointMesh");
78 
79 
80  typedef pointMesh Mesh;
82 
83 
84  // Constructors
85 
86  //- Construct from polyMesh
87  explicit pointMesh(const polyMesh& pMesh);
88 
89 
90  //- Destructor
91  ~pointMesh() = default;
92 
93 
94  // Member Functions
95 
96  //- Return number of points
97  label size() const
98  {
99  return size(*this);
100  }
101 
102  //- Return number of points
103  static label size(const Mesh& mesh)
104  {
105  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
106  }
107 
108  //- Return reference to boundary mesh
109  const pointBoundaryMesh& boundary() const
110  {
111  return boundary_;
112  }
113 
114  //- Return parallel info
115  const globalMeshData& globalData() const
116  {
117  return GeoMesh<polyMesh>::mesh_.globalData();
118  }
119 
120  //- Return database. For now is its polyMesh.
121  const objectRegistry& thisDb() const
122  {
124  }
125 
126 
127  // Mesh motion
128 
129  //- Move points
130  bool movePoints();
131 
132  //- Update the mesh corresponding to given map
133  void updateMesh(const mapPolyMesh& mpm);
134 
135 
136  // Member Operators
137 
138  bool operator!=(const pointMesh& pm) const
139  {
140  return &pm != this;
141  }
142 
143  bool operator==(const pointMesh& pm) const
144  {
145  return &pm == this;
146  }
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Foam::pointMesh::operator==
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:142
Foam::pointMesh::boundary
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:108
Foam::pointMesh::size
static label size(const Mesh &mesh)
Return number of points.
Definition: pointMesh.H:102
Foam::pointMesh::operator!=
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:137
Foam::pointMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:114
Foam::GeoMesh< polyMesh >::mesh_
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:56
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
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:79
Foam::pointMesh::BoundaryMesh
pointBoundaryMesh BoundaryMesh
Definition: pointMesh.H:80
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:50
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:55
Foam::pointMesh::size
label size() const
Return number of points.
Definition: pointMesh.H:96
Foam::pointMesh::thisDb
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:120
Foam::primitiveMesh::nPoints
label nPoints() const
Number of mesh points.
Definition: primitiveMeshI.H:37
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:85
GeoMesh.H
Foam::pointMesh::updateMesh
void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: pointMesh.C:107