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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::facePointPatch
29 
30 Description
31  A pointPatch based on a polyPatch
32 
33 SourceFiles
34  facePointPatch.C
35  newPointPatch.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef facePointPatch_H
40 #define facePointPatch_H
41 
42 #include "pointPatch.H"
43 #include "polyPatch.H"
44 #include "autoPtr.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class processorPointPatch;
52 class cyclicPointPatch;
53 
54 /*---------------------------------------------------------------------------*\
55  Class facePointPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class facePointPatch
59 :
60  public pointPatch
61 {
62 protected:
63 
64  // Protected data
65 
66  //- Reference to the underlying polyPatch
67  const polyPatch& polyPatch_;
68 
69 
70  // Protected Member Functions
71 
72  //- Initialise the calculation of the patch geometry
73  virtual void initGeometry(PstreamBuffers&);
74 
75  //- Calculate the patch geometry
76  virtual void calcGeometry(PstreamBuffers&);
77 
78  //- Initialise the patches for moving points
79  virtual void initMovePoints(PstreamBuffers&, const pointField&);
80 
81  //- Correct patches after moving points
82  virtual void movePoints(PstreamBuffers&, const pointField&);
83 
84  //- Initialise the update of the patch topology
85  virtual void initUpdateMesh(PstreamBuffers&);
86 
87  //- Update of the patch topology
88  virtual void updateMesh(PstreamBuffers&);
89 
90 
91  //- No copy construct
92  facePointPatch(const facePointPatch&) = delete;
93 
94  //- No copy assignment
95  void operator=(const facePointPatch&) = delete;
96 
97 
98 public:
99 
100  // Declare friendship with the coupledPointPatches to allow them to extend
101  // the set of points with those not associated with faces
102  friend class processorPointPatch;
103  friend class cyclicPointPatch;
104 
105 
106  //- Runtime type information
107  TypeName(polyPatch::typeName_());
108 
109 
110  // Declare run-time constructor selection tables
111 
113  (
114  autoPtr,
116  polyPatch,
117  (const polyPatch& patch, const pointBoundaryMesh& bm),
118  (patch, bm)
119  );
120 
121 
122  // Constructors
123 
124  //- Construct from polyPatch and boundary mesh
126  (
127  const polyPatch& p,
128  const pointBoundaryMesh& pm
129  );
130 
131 
132  // Selectors
133 
134  //- Return a pointer to a new patch created on freestore from polyPatch
136  (
137  const polyPatch&,
138  const pointBoundaryMesh&
139  );
140 
141 
142  //- Destructor
143  virtual ~facePointPatch() = default;
144 
145 
146  // Member Functions
147 
148  //- Return the polyPatch
149  virtual const polyPatch& patch() const
150  {
151  return polyPatch_;
152  }
153 
154  //- Return name
155  virtual const word& name() const
156  {
157  return polyPatch_.name();
158  }
159 
160  //- Return size
161  virtual label size() const
162  {
163  return meshPoints().size();
164  }
165 
166  //- Return the index of this patch in the pointBoundaryMesh
167  virtual label index() const
168  {
169  return polyPatch_.index();
170  }
171 
172  //- Return true if this patch field is coupled
173  virtual bool coupled() const
174  {
175  return polyPatch_.coupled();
176  }
177 
178  //- Return mesh points
179  virtual const labelList& meshPoints() const
180  {
181  return polyPatch_.meshPoints();
182  }
183 
184  //- Return pointField of points in patch
185  virtual const pointField& localPoints() const
186  {
187  return polyPatch_.localPoints();
188  }
189 
190  //- Return point unit normals
191  virtual const vectorField& pointNormals() const
192  {
193  return polyPatch_.pointNormals();
194  }
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::facePointPatch::initUpdateMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: facePointPatch.C:69
Foam::facePointPatch::coupled
virtual bool coupled() const
Return true if this patch field is coupled.
Definition: facePointPatch.H:172
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::facePointPatch
A pointPatch based on a polyPatch.
Definition: facePointPatch.H:57
Foam::facePointPatch::initGeometry
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: facePointPatch.C:53
polyPatch.H
Foam::PrimitivePatch::pointNormals
const Field< point_type > & pointNormals() const
Return point normals for patch.
Definition: PrimitivePatch.C:461
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:88
Foam::polyPatch::coupled
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:377
Foam::facePointPatch::pointNormals
virtual const vectorField & pointNormals() const
Return point unit normals.
Definition: facePointPatch.H:190
Foam::facePointPatch::patch
virtual const polyPatch & patch() const
Return the polyPatch.
Definition: facePointPatch.H:148
Foam::processorPointPatch
Processor patch boundary needs to be such that the ordering of points in the patch is the same on bot...
Definition: processorPointPatch.H:59
Foam::facePointPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: facePointPatch.C:57
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::cyclicPointPatch
Cyclic patch for post-processing.
Definition: cyclicPointPatch.H:52
Foam::facePointPatch::~facePointPatch
virtual ~facePointPatch()=default
Destructor.
Foam::facePointPatch::index
virtual label index() const
Return the index of this patch in the pointBoundaryMesh.
Definition: facePointPatch.H:166
Foam::facePointPatch::polyPatch_
const polyPatch & polyPatch_
Reference to the underlying polyPatch.
Definition: facePointPatch.H:66
Foam::facePointPatch::size
virtual label size() const
Return size.
Definition: facePointPatch.H:160
Foam::Field< vector >
Foam::facePointPatch::movePoints
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: facePointPatch.C:65
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::facePointPatch::localPoints
virtual const pointField & localPoints() const
Return pointField of points in patch.
Definition: facePointPatch.H:184
Foam::facePointPatch::meshPoints
virtual const labelList & meshPoints() const
Return mesh points.
Definition: facePointPatch.H:178
Foam::facePointPatch::New
static autoPtr< facePointPatch > New(const polyPatch &, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
Definition: facePointPatchNew.C:34
Foam::facePointPatch::facePointPatch
facePointPatch(const facePointPatch &)=delete
No copy construct.
Foam::facePointPatch::TypeName
TypeName(polyPatch::typeName_())
Runtime type information.
Foam::facePointPatch::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, facePointPatch, polyPatch,(const polyPatch &patch, const pointBoundaryMesh &bm),(patch, bm))
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchIdentifier::index
label index() const noexcept
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:147
Foam::facePointPatch::updateMesh
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Definition: facePointPatch.C:75
Foam::PrimitivePatch::localPoints
const Field< point_type > & localPoints() const
Return pointField of points in patch.
Definition: PrimitivePatch.C:359
Foam::pointBoundaryMesh
Foam::pointBoundaryMesh.
Definition: pointBoundaryMesh.H:56
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
Foam::facePointPatch::operator=
void operator=(const facePointPatch &)=delete
No copy assignment.
Foam::facePointPatch::name
virtual const word & name() const
Return name.
Definition: facePointPatch.H:154
Foam::facePointPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: facePointPatch.C:61
Foam::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
Foam::PrimitivePatch::meshPoints
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Definition: PrimitivePatch.C:330
pointPatch.H
autoPtr.H