OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

globalPointPatch.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-2007 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     globalPointPatch
00027 
00028 Description
00029 
00030 SourceFiles
00031     globalPointPatch.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef globalPointPatch_H
00036 #define globalPointPatch_H
00037 
00038 #include "pointPatch.H"
00039 #include "coupledPointPatch.H"
00040 #include "globalMeshData.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048              Class globalPointPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class globalPointPatch
00052 :
00053     public pointPatch,
00054     public coupledPointPatch
00055 {
00056     // Private data
00057 
00058         //- Reference to the basic globalMeshData
00059         const globalMeshData& globalMeshData_;
00060 
00061         //- Index in the boundary mesh
00062         label boundaryIndex_;
00063 
00064 
00065     // Private Member Functions
00066 
00067         //- Disallow default construct as copy
00068         globalPointPatch
00069         (
00070             const globalPointPatch&
00071         );
00072 
00073         //- Disallow default assignment
00074         void operator=(const globalPointPatch&);
00075 
00076 
00077 public:
00078 
00079     typedef coupledPointPatch CoupledPointPatch;
00080     typedef pointBoundaryMesh BoundaryMesh;
00081 
00082 
00083     //- Runtime type information
00084     TypeName("global");
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         globalPointPatch
00090         (
00091             const globalMeshData& pi,
00092             const pointBoundaryMesh& bm,
00093             const label index
00094         );
00095 
00096 
00097     // Destructor
00098 
00099         virtual ~globalPointPatch();
00100 
00101 
00102     // Member functions
00103 
00104         //- Return name
00105         virtual const word& name() const
00106         {
00107             // There can only be a single patch of this type - therefore
00108             // its name is hard-coded.  
00109             return type();
00110         }
00111 
00112         //- Return size
00113         virtual label size() const
00114         {
00115             return meshPoints().size();
00116         }
00117 
00118         //- Return true if running parallel
00119         virtual bool coupled() const
00120         {
00121             if (Pstream::parRun())
00122             {
00123                 return true;
00124             }
00125             else
00126             {
00127                 return false;
00128             }
00129         }
00130 
00131         //- Return number of faces
00132         virtual label nFaces() const
00133         {
00134             return 0;
00135         }
00136 
00137         //- Return the index of this patch in the pointBoundaryMesh
00138         virtual label index() const
00139         {
00140             return boundaryIndex_;
00141         }
00142 
00143         //- Return mesh points
00144         virtual const labelList& meshPoints() const
00145         {
00146             return globalMeshData_.sharedPointLabels();
00147         }
00148 
00149         //- Return local points.  Not implemented
00150         virtual const pointField& localPoints() const
00151         {
00152             notImplemented("globalPointPatch::localPoints() const");
00153             return pointField::null();
00154         }
00155 
00156         //- Return point normals.  Not implemented
00157         virtual const vectorField& pointNormals() const
00158         {
00159             notImplemented("globalPointPatch::pointNormals() const");
00160             return vectorField::null();
00161         }
00162 
00163         //- Return total number of shared points
00164         virtual label globalPointSize() const
00165         {
00166             return globalMeshData_.nGlobalPoints();
00167         }
00168 
00169         //- Return addressing into the global points list
00170         const labelList& sharedPointAddr() const
00171         {
00172             return globalMeshData_.sharedPointAddr();
00173         }
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd