FreeFOAM The Cross-Platform CFD Toolkit
globalPointPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::globalPointPatch
26 
27 Description
28  Foam::globalPointPatch
29 
30 SourceFiles
31  globalPointPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef globalPointPatch_H
36 #define globalPointPatch_H
37 
38 #include <OpenFOAM/pointPatch.H>
41 #include <OpenFOAM/pointMesh.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class globalPointPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public pointPatch,
55  public coupledPointPatch
56 {
57  // Private data
58 
59  // //- Reference to the basic globalMeshData
60  // const globalMeshData& globalMeshData_;
61 
62  //- Index in the boundary mesh
63  label index_;
64 
65 
66  // Protected Member Functions
67 
68  //- Initialise the calculation of the patch geometry
69  virtual void initGeometry()
70  {}
71 
72  //- Calculate the patch geometry
73  virtual void calcGeometry()
74  {}
75 
76  //- Initialise the patches for moving points
77  virtual void initMovePoints(const pointField&)
78  {}
79 
80  //- Correct patches after moving points
81  virtual void movePoints(const pointField&)
82  {}
83 
84  //- Initialise the update of the patch topology
85  virtual void initUpdateMesh()
86  {}
87 
88  //- Update of the patch topology
89  virtual void updateMesh()
90  {}
91 
92 
93  // Private Member Functions
94 
95  //- Disallow default construct as copy
97  (
98  const globalPointPatch&
99  );
100 
101  //- Disallow default assignment
102  void operator=(const globalPointPatch&);
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("global");
109 
110  // Constructors
111 
112  //- Construct from components
114  (
115  const pointBoundaryMesh&,
116  const label index
117  );
118 
119 
120  // Destructor
121 
122  virtual ~globalPointPatch();
123 
124 
125  // Member functions
126 
127  //- Return name
128  virtual const word& name() const
129  {
130  // There can only be a single patch of this type - therefore
131  // its name is hard-coded.
132  return type();
133  }
134 
135  //- Return size
136  virtual label size() const
137  {
138  return meshPoints().size();
139  }
140 
141  //- Return true if running parallel
142  virtual bool coupled() const
143  {
144  if (Pstream::parRun())
145  {
146  return true;
147  }
148  else
149  {
150  return false;
151  }
152  }
153 
154  //- Return number of faces
155  virtual label nFaces() const
156  {
157  return 0;
158  }
159 
160  //- Return the index of this patch in the pointBoundaryMesh
161  virtual label index() const
162  {
163  return index_;
164  }
165 
166  //- Return mesh points
167  virtual const labelList& meshPoints() const
168  {
170  }
171 
172  //- Return local points. Not implemented
173  virtual const pointField& localPoints() const
174  {
175  notImplemented("globalPointPatch::localPoints() const");
176  return pointField::null();
177  }
178 
179  //- Return point normals. Not implemented
180  virtual const vectorField& pointNormals() const
181  {
182  notImplemented("globalPointPatch::pointNormals() const");
183  return vectorField::null();
184  }
185 
186  //- Return total number of shared points
187  virtual label globalPointSize() const
188  {
189  return boundaryMesh().mesh().globalData().nGlobalPoints();
190  }
191 
192  //- Return addressing into the global points list
193  const labelList& sharedPointAddr() const
194  {
196  }
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************ vim: set sw=4 sts=4 et: ************************ //