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 | Copyright (C) 2011-2013 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, UpdateableMeshObject, pointMesh>,
52  public GeoMesh<polyMesh>
53 {
54  // Permanent data
55 
56  //- Boundary mesh
58 
59 
60  // Private Member Functions
61 
62  //- Map all fields
63  void mapFields(const mapPolyMesh&);
64 
65  //- Disallow default bitwise copy construct
66  pointMesh(const pointMesh&);
67 
68  //- Disallow default bitwise assignment
69  void operator=(const pointMesh&);
70 
71 
72 public:
73 
74  // Declare name of the class and its debug switch
75  ClassName("pointMesh");
76 
77 
78  typedef pointMesh Mesh;
80 
81 
82  // Constructors
83 
84  //- Construct from polyMesh
85  explicit pointMesh(const polyMesh& pMesh);
86 
87 
88  //- Destructor
89  ~pointMesh();
90 
91 
92  // Member Functions
93 
94  //- Return number of points
95  label size() const
96  {
97  return size(*this);
98  }
99 
100  //- Return number of points
101  static label size(const Mesh& mesh)
102  {
103  return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
104  }
105 
106  //- Return reference to boundary mesh
107  const pointBoundaryMesh& boundary() const
108  {
109  return boundary_;
110  }
111 
112  //- Return parallel info
113  const globalMeshData& globalData() const
114  {
115  return GeoMesh<polyMesh>::mesh_.globalData();
116  }
117 
118  //- Return database. For now is its polyMesh.
119  const objectRegistry& thisDb() const
120  {
122  }
123 
124 
125  // Mesh motion
126 
127  //- Move points
128  bool movePoints();
129 
130  //- Update the mesh corresponding to given map
131  void updateMesh(const mapPolyMesh& mpm);
132 
133 
134  // Member Operators
135 
136  bool operator!=(const pointMesh& pm) const
137  {
138  return &pm != this;
139  }
140 
141  bool operator==(const pointMesh& pm) const
142  {
143  return &pm == this;
144  }
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
Foam::pointMesh::operator==
bool operator==(const pointMesh &pm) const
Definition: pointMesh.H:140
Foam::pointMesh::boundary
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: pointMesh.H:106
Foam::pointMesh::mapFields
void mapFields(const mapPolyMesh &)
Map all fields.
Definition: pointMesh.C:45
Foam::pointMesh::size
static label size(const Mesh &mesh)
Return number of points.
Definition: pointMesh.H:100
Foam::pointMesh::operator!=
bool operator!=(const pointMesh &pm) const
Definition: pointMesh.H:135
Foam::pointMesh::boundary_
pointBoundaryMesh boundary_
Boundary mesh.
Definition: pointMesh.H:56
Foam::pointMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: pointMesh.H:112
Foam::GeoMesh< polyMesh >::mesh_
const polyMesh & mesh_
Reference to Mesh.
Definition: GeoMesh.H:54
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
pointBoundaryMesh.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::primitiveMesh::nPoints
label nPoints() const
Definition: primitiveMeshI.H:35
Foam::label
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
Foam::MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::mesh
const polyMesh & mesh() const
Definition: MeshObject.H:144
Foam::pointMesh::ClassName
ClassName("pointMesh")
Foam::pointMesh::Mesh
pointMesh Mesh
Definition: pointMesh.H:77
Foam::pointMesh::BoundaryMesh
pointBoundaryMesh BoundaryMesh
Definition: pointMesh.H:78
Foam::globalMeshData
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Definition: globalMeshData.H:106
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:46
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
Foam::pointMesh::pointMesh
pointMesh(const pointMesh &)
Disallow default bitwise copy construct.
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:52
Foam::pointMesh::size
label size() const
Return number of points.
Definition: pointMesh.H:94
Foam::pointMesh::thisDb
const objectRegistry & thisDb() const
Return database. For now is its polyMesh.
Definition: pointMesh.H:118
Foam::pointMesh::~pointMesh
~pointMesh()
Destructor.
Definition: pointMesh.C:93
Foam::pointMesh::operator=
void operator=(const pointMesh &)
Disallow default bitwise assignment.
MeshObject.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::MeshObject
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:81
Foam::pointMesh::movePoints
bool movePoints()
Move points.
Definition: pointMesh.C:105
Foam::GeoMesh::thisDb
const objectRegistry & thisDb() const
Return the object registry.
Definition: GeoMesh.H:77
GeoMesh.H
Foam::pointMesh::updateMesh
void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: pointMesh.C:119