OpenFOAM logo
Open Source CFD Toolkit

pointMesh.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     pointMesh
00027 
00028 Description
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef pointMesh_H
00033 #define pointMesh_H
00034 
00035 #include "polyMesh.H"
00036 #include "pointBoundaryMesh.H"
00037 #include "primitiveMesh.H"
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace Foam
00042 {
00043 
00044 /*---------------------------------------------------------------------------*\
00045                            Class pointMesh Declaration
00046 \*---------------------------------------------------------------------------*/
00047 
00048 class pointMesh
00049 {
00050     // Permanent data
00051 
00052         //- Reference to underlying polyMesh
00053         const polyMesh& mesh_;
00054 
00055         //- Boundary mesh
00056         pointBoundaryMesh boundary_;
00057 
00058 
00059     // Private Member Functions
00060 
00061         //- Disallow default bitwise copy construct
00062         pointMesh(const pointMesh&);
00063 
00064         //- Disallow default bitwise assignment
00065         void operator=(const pointMesh&);
00066 
00067         //- Check for and create a parallel point patch
00068         void addParallelPointPatch();
00069 
00070 
00071 public:
00072 
00073     typedef pointMesh Mesh;
00074     typedef pointBoundaryMesh BoundaryMesh;
00075 
00076     // Constructors
00077 
00078         //- Construct from polyMesh
00079         explicit pointMesh(const polyMesh& pMesh);
00080 
00081 
00082     // Member Functions
00083 
00084         //- Return reference to polyMesh
00085         const polyMesh& operator()() const
00086         {
00087             return mesh_;
00088         }
00089 
00090         //- Return number of points
00091         label size() const
00092         {
00093             return size(*this);
00094         }
00095 
00096         //- Return number of points
00097         static label size(const Mesh& mesh)
00098         {
00099             return mesh.mesh_.nPoints();
00100         }
00101 
00102         //- Return number of points (checking of patch size.  Reconsider)
00103         label nPoints() const
00104         {
00105             return mesh_.nPoints();
00106         }
00107 
00108         //- Return number of cells (checking of patch size.  Reconsider)
00109         label nCells() const
00110         {
00111             return mesh_.nCells();
00112         }
00113 
00114         //- Return reference to boundary mesh
00115         const pointBoundaryMesh& boundary() const
00116         {
00117             return boundary_;
00118         }
00119 
00120         //- Correct stuff for moving mesh.
00121         bool movePoints()
00122         {
00123             return true;
00124         }
00125 
00126         //- Return parallel info
00127         const parallelInfo& parallelData() const
00128         {
00129             return mesh_.parallelData();
00130         }
00131 
00132 
00133     // Member Operators
00134 
00135         bool operator!=(const pointMesh& pm) const
00136         {
00137             return &pm != this;
00138         }
00139 
00140         bool operator==(const pointMesh& pm) const
00141         {
00142             return &pm == this;
00143         }
00144 };
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00152 
00153 #endif
00154 
00155 // ************************************************************************* //
For further information go to www.openfoam.org