initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / pointMesh / pointPatches / derived / global / globalPointPatch.H
blob990ab0de9a45c5356c2a6316c7eaec7c5884bd2b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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::globalPointPatch
28 Description
29     Foam::globalPointPatch
31 SourceFiles
32     globalPointPatch.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef globalPointPatch_H
37 #define globalPointPatch_H
39 #include "pointPatch.H"
40 #include "coupledPointPatch.H"
41 #include "globalMeshData.H"
42 #include "pointMesh.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                       Class globalPointPatch Declaration
51 \*---------------------------------------------------------------------------*/
53 class globalPointPatch
55     public pointPatch,
56     public coupledPointPatch
58     // Private data
60         // //- Reference to the basic globalMeshData
61         // const globalMeshData& globalMeshData_;
63         //- Index in the boundary mesh
64         label index_;
67     // Protected Member Functions
69         //- Initialise the calculation of the patch geometry
70         virtual void initGeometry()
71         {}
73         //- Calculate the patch geometry
74         virtual void calcGeometry()
75         {}
77         //- Initialise the patches for moving points
78         virtual void initMovePoints(const pointField&)
79         {}
81         //- Correct patches after moving points
82         virtual void movePoints(const pointField&)
83         {}
85         //- Initialise the update of the patch topology
86         virtual void initUpdateMesh()
87         {}
89         //- Update of the patch topology
90         virtual void updateMesh()
91         {}
94     // Private Member Functions
96         //- Disallow default construct as copy
97         globalPointPatch
98         (
99             const globalPointPatch&
100         );
102         //- Disallow default assignment
103         void operator=(const globalPointPatch&);
106 public:
108     //- Runtime type information
109     TypeName("global");
111     // Constructors
113         //- Construct from components
114         globalPointPatch
115         (
116             const pointBoundaryMesh&,
117             const label index
118         );
121     // Destructor
123         virtual ~globalPointPatch();
126     // Member functions
128         //- Return name
129         virtual const word& name() const
130         {
131             // There can only be a single patch of this type - therefore
132             // its name is hard-coded.
133             return type();
134         }
136         //- Return size
137         virtual label size() const
138         {
139             return meshPoints().size();
140         }
142         //- Return true if running parallel
143         virtual bool coupled() const
144         {
145             if (Pstream::parRun())
146             {
147                 return true;
148             }
149             else
150             {
151                 return false;
152             }
153         }
155         //- Return number of faces
156         virtual label nFaces() const
157         {
158             return 0;
159         }
161         //- Return the index of this patch in the pointBoundaryMesh
162         virtual label index() const
163         {
164             return index_;
165         }
167         //- Return mesh points
168         virtual const labelList& meshPoints() const
169         {
170             return boundaryMesh().mesh().globalData().sharedPointLabels();
171         }
173         //- Return local points.  Not implemented
174         virtual const pointField& localPoints() const
175         {
176             notImplemented("globalPointPatch::localPoints() const");
177             return pointField::null();
178         }
180         //- Return point normals.  Not implemented
181         virtual const vectorField& pointNormals() const
182         {
183             notImplemented("globalPointPatch::pointNormals() const");
184             return vectorField::null();
185         }
187         //- Return total number of shared points
188         virtual label globalPointSize() const
189         {
190             return boundaryMesh().mesh().globalData().nGlobalPoints();
191         }
193         //- Return addressing into the global points list
194         const labelList& sharedPointAddr() const
195         {
196             return boundaryMesh().mesh().globalData().sharedPointAddr();
197         }
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 } // End namespace Foam
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 #endif
209 // ************************************************************************* //