FreeFOAM The Cross-Platform CFD Toolkit
facePointPatch.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::facePointPatch
26 
27 Description
28  A pointPatch based on a polyPatch
29 
30 SourceFiles
31  facePointPatch.C
32  facePointPatchM.C
33  newPointPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef facePointPatch_H
38 #define facePointPatch_H
39 
40 #include <OpenFOAM/pointPatch.H>
41 #include <OpenFOAM/polyPatch.H>
42 #include <OpenFOAM/autoPtr.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class processorPointPatch;
50 class cyclicPointPatch;
51 
52 /*---------------------------------------------------------------------------*\
53  Class facePointPatch Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public pointPatch
59 {
60 protected:
61 
62  // Protected data
63 
64  //- Reference to the underlying polyPatch
66 
67  // Optional data used if the pointPatch has points not associated
68  // with faces, i.e. not accessible via polyPatch
69 
73 
74 
75  // Protected Member Functions
76 
77  //- Initialise the calculation of the patch geometry
78  virtual void initGeometry();
79 
80  //- Calculate the patch geometry
81  virtual void calcGeometry();
82 
83  //- Initialise the patches for moving points
84  virtual void initMovePoints(const pointField&);
85 
86  //- Correct patches after moving points
87  virtual void movePoints(const pointField&);
88 
89  //- Initialise the update of the patch topology
90  virtual void initUpdateMesh();
91 
92  //- Update of the patch topology
93  virtual void updateMesh();
94 
95 
96 private:
97 
98  // Private Member Functions
99 
100  //- Disallow default bitwise copy construct
102 
103  //- Disallow default bitwise assignment
104  void operator=(const facePointPatch&);
105 
106 
107 public:
108 
109  // Declare friendship with the coupledPointPatches to allow them to extend
110  // the set of points with those not associated with faces
111  friend class processorPointPatch;
112  friend class cyclicPointPatch;
113 
114 
115  //- Runtime type information
116  TypeName(polyPatch::typeName_());
117 
118 
119  // Declare run-time constructor selection tables
120 
122  (
123  autoPtr,
125  polyPatch,
126  (const polyPatch& patch, const pointBoundaryMesh& bm),
127  (patch, bm)
128  );
129 
130 
131  // Constructors
132 
133  //- Construct from polyPatch
135  (
136  const polyPatch&,
137  const pointBoundaryMesh&
138  );
139 
140 
141  // Selectors
142 
143  //- Return a pointer to a new patch created on freestore from polyPatch
145  (
146  const polyPatch&,
147  const pointBoundaryMesh&
148  );
149 
150 
151  // Destructor
152 
153  virtual ~facePointPatch()
154  {}
155 
156 
157  // Member Functions
158 
159  //- Return the polyPatch
160  const polyPatch& patch() const
161  {
162  return polyPatch_;
163  }
164 
165  //- Return name
166  virtual const word& name() const
167  {
168  return polyPatch_.name();
169  }
170 
171  //- Return size
172  virtual label size() const
173  {
174  return meshPoints().size();
175  }
176 
177  //- Return the index of this patch in the pointBoundaryMesh
178  virtual label index() const
179  {
180  return polyPatch_.index();
181  }
182 
183  //- Return mesh points
184  virtual const labelList& meshPoints() const;
185 
186  //- Return pointField of points in patch
187  virtual const pointField& localPoints() const;
188 
189  //- Return point unit normals
190  virtual const vectorField& pointNormals() const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************ vim: set sw=4 sts=4 et: ************************ //