facePointPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
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  newPointPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef facePointPatch_H
37 #define facePointPatch_H
38 
39 #include "pointPatch.H"
40 #include "polyPatch.H"
41 #include "autoPtr.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class processorPointPatch;
49 class cyclicPointPatch;
50 
51 /*---------------------------------------------------------------------------*\
52  Class facePointPatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class facePointPatch
56 :
57  public pointPatch
58 {
59 protected:
60 
61  // Protected data
62 
63  //- Reference to the underlying polyPatch
64  const polyPatch& polyPatch_;
65 
66 
67  // Protected Member Functions
68 
69  //- Initialise the calculation of the patch geometry
70  virtual void initGeometry(PstreamBuffers&);
71 
72  //- Calculate the patch geometry
73  virtual void calcGeometry(PstreamBuffers&);
74 
75  //- Initialise the patches for moving points
76  virtual void initMovePoints(PstreamBuffers&, const pointField&);
77 
78  //- Correct patches after moving points
79  virtual void movePoints(PstreamBuffers&, const pointField&);
80 
81  //- Initialise the update of the patch topology
82  virtual void initUpdateMesh(PstreamBuffers&);
83 
84  //- Update of the patch topology
85  virtual void updateMesh(PstreamBuffers&);
86 
87 
88 private:
89 
90  // Private Member Functions
91 
92  //- Disallow default bitwise copy construct
94 
95  //- Disallow default bitwise assignment
96  void operator=(const facePointPatch&);
97 
98 
99 public:
100 
101  // Declare friendship with the coupledPointPatches to allow them to extend
102  // the set of points with those not associated with faces
103  friend class processorPointPatch;
104  friend class cyclicPointPatch;
105 
106 
107  //- Runtime type information
108  TypeName(polyPatch::typeName_());
109 
110 
111  // Declare run-time constructor selection tables
112 
114  (
115  autoPtr,
117  polyPatch,
118  (const polyPatch& patch, const pointBoundaryMesh& bm),
119  (patch, bm)
120  );
121 
122 
123  // Constructors
124 
125  //- Construct from polyPatch
127  (
128  const polyPatch&,
129  const pointBoundaryMesh&
130  );
131 
132 
133  // Selectors
134 
135  //- Return a pointer to a new patch created on freestore from polyPatch
137  (
138  const polyPatch&,
139  const pointBoundaryMesh&
140  );
141 
142 
143  //- Destructor
144  virtual ~facePointPatch()
145  {}
146 
147 
148  // Member Functions
149 
150  //- Return the polyPatch
151  const polyPatch& patch() const
152  {
153  return polyPatch_;
154  }
155 
156  //- Return name
157  virtual const word& name() const
158  {
159  return polyPatch_.name();
160  }
161 
162  //- Return size
163  virtual label size() const
164  {
165  return meshPoints().size();
166  }
167 
168  //- Return the index of this patch in the pointBoundaryMesh
169  virtual label index() const
170  {
171  return polyPatch_.index();
172  }
173 
174  //- Return true if this patch field is coupled
175  virtual bool coupled() const
176  {
177  return polyPatch_.coupled();
178  }
179 
180  //- Return mesh points
181  virtual const labelList& meshPoints() const
182  {
183  return polyPatch_.meshPoints();
184  }
185 
186 
187  //- Return pointField of points in patch
188  virtual const pointField& localPoints() const
189  {
190  return polyPatch_.localPoints();
191  }
192 
193 
194  //- Return point unit normals
195  virtual const vectorField& pointNormals() const
196  {
197  return polyPatch_.pointNormals();
198  }
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
virtual const vectorField & pointNormals() const
Return point unit normals.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const word & name() const
Return name.
virtual ~facePointPatch()
Destructor.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Foam::pointBoundaryMesh.
virtual label size() const
Return size.
const Field< PointType > & pointNormals() const
Return point normals for patch.
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
const polyPatch & polyPatch_
Reference to the underlying polyPatch.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual const word & name() const
Return name.
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
Cyclic patch for post-processing.
virtual label index() const
Return the index of this patch in the pointBoundaryMesh.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
static autoPtr< facePointPatch > New(const polyPatch &, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
A pointPatch based on a polyPatch.
TypeName(polyPatch::typeName_())
Runtime type information.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:310
A class for handling words, derived from string.
Definition: word.H:59
declareRunTimeSelectionTable(autoPtr, facePointPatch, polyPatch,(const polyPatch &patch, const pointBoundaryMesh &bm),(patch, bm))
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual const labelList & meshPoints() const
Return mesh points.
virtual const pointField & localPoints() const
Return pointField of points in patch.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
const polyPatch & patch() const
Return the polyPatch.
label index() const
Return the index of this patch in the boundaryMesh.
virtual bool coupled() const
Return true if this patch field is coupled.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Namespace for OpenFOAM.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.