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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::facePointPatch
29
30Description
31 A pointPatch based on a polyPatch
32
33SourceFiles
34 facePointPatch.C
35 facePointPatchNew.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_facePointPatch_H
40#define Foam_facePointPatch_H
41
42#include "pointPatch.H"
43#include "polyPatch.H"
44#include "autoPtr.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51class processorPointPatch;
52class cyclicPointPatch;
53
54/*---------------------------------------------------------------------------*\
55 Class facePointPatch Declaration
56\*---------------------------------------------------------------------------*/
59:
60 public pointPatch
61{
62protected:
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
98public:
99
100 // Declare friendship with the coupledPointPatches to allow them to extend
101 // the set of points with those not associated with faces
103 friend class cyclicPointPatch;
104
105
106 //- Runtime type information
107 TypeName(polyPatch::typeName_());
108
109
110 // Declare run-time constructor selection tables
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// ************************************************************************* //
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const Field< point_type > & pointNormals() const
Return point normals for patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Cyclic patch for post-processing.
A pointPatch based on a polyPatch.
virtual ~facePointPatch()=default
Destructor.
virtual label size() const
Return size.
virtual const word & name() const
Return name.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving 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.
const polyPatch & polyPatch_
Reference to the underlying polyPatch.
virtual const polyPatch & patch() const
Return the polyPatch.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
facePointPatch(const facePointPatch &)=delete
No copy construct.
void operator=(const facePointPatch &)=delete
No copy assignment.
virtual const labelList & meshPoints() const
Return mesh points.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual const vectorField & pointNormals() const
Return point unit normals.
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.
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
Foam::pointBoundaryMesh.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition: polyPatch.H:380
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 Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73