Loading...
Searching...
No Matches
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
54/*---------------------------------------------------------------------------*\
55 Class facePointPatch Declaration
56\*---------------------------------------------------------------------------*/
57
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
102 friend class processorPointPatch;
103 friend class cyclicPointPatch;
104
105
106 //- Runtime type information
107 TypeName(polyPatch::typeName_());
109
110 // Declare run-time constructor selection tables
111
113 (
114 autoPtr,
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 //- Construct given the original patch and a map
133 (
134 const facePointPatch& pp,
135 const pointBoundaryMesh& bm,
136 const label index,
137 const labelUList& mapAddressing,
138 const labelUList& reversePointMap
139 );
140
141 //- Construct and return a subset clone,
142 //- resetting the point list and boundary mesh
144 (
145 const pointBoundaryMesh& bm,
146 const label index,
147 const labelUList& mapAddressing,
148 const labelUList& reversePointMap
149 ) const
150 {
152 (
153 *this,
154 bm,
155 index,
156 mapAddressing,
157 reversePointMap
158 );
159 }
160
161
162 // Selectors
163
164 //- Return a pointer to a new patch created on freestore from polyPatch
166 (
167 const polyPatch&,
168 const pointBoundaryMesh&
169 );
170
171
172 //- Destructor
173 virtual ~facePointPatch() = default;
174
175
176 // Member Functions
177
178 //- Return the polyPatch
179 virtual const polyPatch& patch() const
180 {
181 return polyPatch_;
182 }
183
184 //- Return name
185 virtual const word& name() const
186 {
187 return polyPatch_.name();
188 }
189
190 //- Return size
191 virtual label size() const
192 {
193 return meshPoints().size();
194 }
195
196 //- Return the index of this patch in the pointBoundaryMesh
197 virtual label index() const
199 return polyPatch_.index();
200 }
201
202 //- Return true if this patch field is coupled
203 virtual bool coupled() const
204 {
205 return polyPatch_.coupled();
207
208 //- Return mesh points
209 virtual const labelList& meshPoints() const
210 {
211 return polyPatch_.meshPoints();
212 }
213
214 //- Return pointField of points in patch
215 virtual const pointField& localPoints() const
216 {
217 return polyPatch_.localPoints();
218 }
219
220 //- Return point unit normals
221 virtual const vectorField& pointNormals() const
223 return polyPatch_.pointNormals();
224 }
225};
226
227
228// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229
230} // End namespace Foam
231
232// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233
234#endif
235
236// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > NewFrom(Args &&... args)
Construct autoPtr from derived type with forwarding arguments.
Definition autoPtr.H:193
Cyclic patch for post-processing.
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.
friend class processorPointPatch
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 autoPtr< pointPatch > clone(const pointBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const labelUList &reversePointMap) const
Construct and return a subset clone, resetting the point list and boundary mesh.
friend class cyclicPointPatch
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.
const word & name() const noexcept
The patch name.
A pointBoundaryMesh is a pointPatch list with registered IO, a reference to the associated pointMesh,...
friend class pointBoundaryMesh
Definition pointPatch.H:81
pointPatch(const pointPatch &)=delete
No copy construct.
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
Definition polyPatch.H:469
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:66
volScalarField & p
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< vector > vectorField
Specialisation of Field<T> for vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#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:68