initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / OpenFOAM / meshes / pointMesh / pointMesh.H
blobe760ab3cab73674e4fa2cd98363c0d90a073b77e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::pointMesh
28 Description
29     Mesh representing a set of points created from polyMesh.
31 \*---------------------------------------------------------------------------*/
33 #ifndef pointMesh_H
34 #define pointMesh_H
36 #include "GeoMesh.H"
37 #include "polyMesh.H"
38 #include "pointBoundaryMesh.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                            Class pointMesh Declaration
47 \*---------------------------------------------------------------------------*/
49 class pointMesh
51     public GeoMesh<polyMesh>
53     // Permanent data
55         //- Boundary mesh
56         pointBoundaryMesh boundary_;
59     // Private Member Functions
61         //- Map all fields
62         void mapFields(const mapPolyMesh&);
64         //- Disallow default bitwise copy construct
65         pointMesh(const pointMesh&);
67         //- Disallow default bitwise assignment
68         void operator=(const pointMesh&);
71 public:
73     typedef pointMesh Mesh;
74     typedef pointBoundaryMesh BoundaryMesh;
77     // Constructors
79         //- Construct from polyMesh
80         explicit pointMesh
81         (
82             const polyMesh& pMesh,
83             bool alwaysConstructGlobalPatch = false
84         );
87     // Member Functions
89         //- Return number of points
90         label size() const
91         {
92             return size(*this);
93         }
95         //- Return number of points
96         static label size(const Mesh& mesh)
97         {
98             return mesh.mesh_.nPoints();
99         }
101         //- Return reference to boundary mesh
102         const pointBoundaryMesh& boundary() const
103         {
104             return boundary_;
105         }
107         //- Return parallel info
108         const globalMeshData& globalData() const
109         {
110             return mesh_.globalData();
111         }
114         // Mesh motion
116             //- Move points, returns volumes swept by faces in motion
117             void movePoints(const pointField&);
119             //- Update the mesh corresponding to given map
120             void updateMesh(const mapPolyMesh& mpm);
123     // Member Operators
125         bool operator!=(const pointMesh& pm) const
126         {
127             return &pm != this;
128         }
130         bool operator==(const pointMesh& pm) const
131         {
132             return &pm == this;
133         }
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 #endif
145 // ************************************************************************* //