FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::globalPointPatch
00026 
00027 Description
00028     Foam::globalPointPatch
00029 
00030 SourceFiles
00031     globalPointPatch.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef globalPointPatch_H
00036 #define globalPointPatch_H
00037 
00038 #include <OpenFOAM/pointPatch.H>
00039 #include <OpenFOAM/coupledPointPatch.H>
00040 #include <OpenFOAM/globalMeshData.H>
00041 #include <OpenFOAM/pointMesh.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                       Class globalPointPatch Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class globalPointPatch
00053 :
00054     public pointPatch,
00055     public coupledPointPatch
00056 {
00057     // Private data
00058 
00059         // //- Reference to the basic globalMeshData
00060         // const globalMeshData& globalMeshData_;
00061 
00062         //- Index in the boundary mesh
00063         label index_;
00064 
00065 
00066     // Protected Member Functions
00067 
00068         //- Initialise the calculation of the patch geometry
00069         virtual void initGeometry()
00070         {}
00071 
00072         //- Calculate the patch geometry
00073         virtual void calcGeometry()
00074         {}
00075 
00076         //- Initialise the patches for moving points
00077         virtual void initMovePoints(const pointField&)
00078         {}
00079 
00080         //- Correct patches after moving points
00081         virtual void movePoints(const pointField&)
00082         {}
00083 
00084         //- Initialise the update of the patch topology
00085         virtual void initUpdateMesh()
00086         {}
00087 
00088         //- Update of the patch topology
00089         virtual void updateMesh()
00090         {}
00091 
00092 
00093     // Private Member Functions
00094 
00095         //- Disallow default construct as copy
00096         globalPointPatch
00097         (
00098             const globalPointPatch&
00099         );
00100 
00101         //- Disallow default assignment
00102         void operator=(const globalPointPatch&);
00103 
00104 
00105 public:
00106 
00107     //- Runtime type information
00108     TypeName("global");
00109 
00110     // Constructors
00111 
00112         //- Construct from components
00113         globalPointPatch
00114         (
00115             const pointBoundaryMesh&,
00116             const label index
00117         );
00118 
00119 
00120     // Destructor
00121 
00122         virtual ~globalPointPatch();
00123 
00124 
00125     // Member functions
00126 
00127         //- Return name
00128         virtual const word& name() const
00129         {
00130             // There can only be a single patch of this type - therefore
00131             // its name is hard-coded.
00132             return type();
00133         }
00134 
00135         //- Return size
00136         virtual label size() const
00137         {
00138             return meshPoints().size();
00139         }
00140 
00141         //- Return true if running parallel
00142         virtual bool coupled() const
00143         {
00144             if (Pstream::parRun())
00145             {
00146                 return true;
00147             }
00148             else
00149             {
00150                 return false;
00151             }
00152         }
00153 
00154         //- Return number of faces
00155         virtual label nFaces() const
00156         {
00157             return 0;
00158         }
00159 
00160         //- Return the index of this patch in the pointBoundaryMesh
00161         virtual label index() const
00162         {
00163             return index_;
00164         }
00165 
00166         //- Return mesh points
00167         virtual const labelList& meshPoints() const
00168         {
00169             return boundaryMesh().mesh().globalData().sharedPointLabels();
00170         }
00171 
00172         //- Return local points.  Not implemented
00173         virtual const pointField& localPoints() const
00174         {
00175             notImplemented("globalPointPatch::localPoints() const");
00176             return pointField::null();
00177         }
00178 
00179         //- Return point normals.  Not implemented
00180         virtual const vectorField& pointNormals() const
00181         {
00182             notImplemented("globalPointPatch::pointNormals() const");
00183             return vectorField::null();
00184         }
00185 
00186         //- Return total number of shared points
00187         virtual label globalPointSize() const
00188         {
00189             return boundaryMesh().mesh().globalData().nGlobalPoints();
00190         }
00191 
00192         //- Return addressing into the global points list
00193         const labelList& sharedPointAddr() const
00194         {
00195             return boundaryMesh().mesh().globalData().sharedPointAddr();
00196         }
00197 };
00198 
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 } // End namespace Foam
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 #endif
00207 
00208 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines