All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2022 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 initCalcGeometry(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 initTopoChange(PstreamBuffers&);
83 
84  //- Update of the patch topology
85  virtual void topoChange(PstreamBuffers&);
86 
87 
88 public:
89 
90  // Declare friendship with the coupledPointPatches to allow them to extend
91  // the set of points with those not associated with faces
92  friend class processorPointPatch;
93  friend class cyclicPointPatch;
94 
95 
96  //- Runtime type information
97  TypeName(polyPatch::typeName_());
98 
99 
100  // Declare run-time constructor selection tables
101 
103  (
104  autoPtr,
106  polyPatch,
107  (const polyPatch& patch, const pointBoundaryMesh& bm),
108  (patch, bm)
109  );
110 
111 
112  // Constructors
113 
114  //- Construct from polyPatch
116  (
117  const polyPatch&,
118  const pointBoundaryMesh&
119  );
120 
121  //- Disallow default bitwise copy construction
122  facePointPatch(const facePointPatch&) = delete;
123 
124 
125  // Selectors
126 
127  //- Return a pointer to a new patch created on freestore from polyPatch
129  (
130  const polyPatch&,
131  const pointBoundaryMesh&
132  );
133 
134 
135  //- Destructor
136  virtual ~facePointPatch()
137  {}
138 
139 
140  // Member Functions
141 
142  //- Return the polyPatch
143  const polyPatch& patch() const
144  {
145  return polyPatch_;
146  }
147 
148  //- Return name
149  virtual const word& name() const
150  {
151  return polyPatch_.name();
152  }
153 
154  //- Return size
155  virtual label size() const
156  {
157  return meshPoints().size();
158  }
159 
160  //- Return the index of this patch in the pointBoundaryMesh
161  virtual label index() const
162  {
163  return polyPatch_.index();
164  }
165 
166  //- Return true if this patch field is coupled
167  virtual bool coupled() const
168  {
169  return polyPatch_.coupled();
170  }
171 
172  //- Return mesh points
173  virtual const labelList& meshPoints() const
174  {
175  return polyPatch_.meshPoints();
176  }
177 
178 
179  //- Return pointField of points in patch
180  virtual const pointField& localPoints() const
181  {
182  return polyPatch_.localPoints();
183  }
184 
185 
186  //- Return point unit normals
187  virtual const vectorField& pointNormals() const
188  {
189  return polyPatch_.pointNormals();
190  }
191 
192 
193  // Member Operators
194 
195  //- Disallow default bitwise assignment
196  void operator=(const facePointPatch&) = delete;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
const Field< PointType > & pointNormals() const
Return point normals for patch.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Cyclic patch for post-processing.
A pointPatch based on a polyPatch.
virtual label size() const
Return size.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
virtual const labelList & meshPoints() const
Return mesh points.
virtual bool coupled() const
Return true if this patch field is coupled.
virtual label index() const
Return the index of this patch in the pointBoundaryMesh.
virtual const pointField & localPoints() const
Return pointField of points in patch.
facePointPatch(const polyPatch &, const pointBoundaryMesh &)
Construct from polyPatch.
virtual ~facePointPatch()
Destructor.
const polyPatch & polyPatch_
Reference to the underlying polyPatch.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
void operator=(const facePointPatch &)=delete
Disallow default bitwise assignment.
const polyPatch & patch() const
Return the polyPatch.
virtual const word & name() const
Return name.
virtual const vectorField & pointNormals() const
Return point unit normals.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
static autoPtr< facePointPatch > New(const polyPatch &, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
declareRunTimeSelectionTable(autoPtr, facePointPatch, polyPatch,(const polyPatch &patch, const pointBoundaryMesh &bm),(patch, bm))
TypeName(polyPatch::typeName_())
Runtime type information.
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
Foam::pointBoundaryMesh.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:290
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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