Loading...
Searching...
No Matches
meshPointPatch.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) 2016 OpenFOAM Foundation
9 Copyright (C) 2024 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::meshPointPatch
29
30Description
31 pointPatch with explicitly provided points instead of using the points
32 of a polyPatch.
33
34 Note: does not constrain displacement - is not a constraint patch.
35
36SourceFiles
37 meshPointPatch.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef meshPointPatch_H
42#define meshPointPatch_H
43
44#include "pointPatch.H"
45#include "polyPatch.H"
46#include "autoPtr.H"
47#include "patchIdentifier.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
54/*---------------------------------------------------------------------------*\
55 Class meshPointPatch Declaration
56\*---------------------------------------------------------------------------*/
57
58class meshPointPatch
59:
60 public pointPatch
61{
62private:
63
64 // Private Member Functions
65
66 //- No copy construct
67 meshPointPatch(const meshPointPatch&) = delete;
68
69 //- No copy assignment
70 void operator=(const meshPointPatch&) = delete;
71
72
73protected:
74
75 // Protected Member Data
76
77 //- Explicit mesh points
82 //- Demand-driven local points
84
85 //- Demand-driven local normals (assumes constructed with pointNormals
86 // or normal-only-constraint)
88
89
90 // Protected Member Functions
91
92 //- Correct patches after moving points
93 virtual void movePoints(PstreamBuffers&, const pointField&);
94
95 //- Update of the patch topology
96 virtual void updateMesh(PstreamBuffers&);
97
98
99public:
100
101 //- Runtime type information
102 TypeName("meshPoint");
103
104
105 // Constructors
106
107 //- Construct from components
108 meshPointPatch
109 (
110 const word& name,
111 const labelUList& meshPoints,
113 const label index,
115 const word& patchType
116 );
117
118 //- Construct from single-constraint (i.e. slip, provided normals)
119 meshPointPatch
120 (
121 const word& name,
122 const labelUList& meshPoints,
124 const label index,
125 const pointBoundaryMesh& bm,
126 const word& patchType
127 );
128
129 //- Construct from dictionary
130 meshPointPatch
131 (
132 const word& name,
133 const dictionary& dict,
134 const label index,
135 const pointBoundaryMesh& bm,
136 const word& patchType
137 );
138
139 //- Construct given the original patch and a map
140 meshPointPatch
141 (
142 const meshPointPatch& pp,
143 const pointBoundaryMesh& bm,
144 const label index,
145 const labelUList& mapAddressing,
146 const labelUList& reversePointMap
147 );
148
149 //- Construct and return a subset clone,
150 //- resetting the point list and boundary mesh
152 (
153 const pointBoundaryMesh& bm,
154 const label index,
155 const labelUList& mapAddressing,
156 const labelUList& reversePointMap
157 ) const
158 {
160 (
161 *this,
162 bm,
163 index,
164 mapAddressing,
165 reversePointMap
166 );
167 }
168
169
170 //- Destructor
171 virtual ~meshPointPatch() = default;
172
174 // Member Functions
175
176 //- Return size
177 virtual label size() const
178 {
179 return meshPoints().size();
180 }
181
182 //- Return mesh points
183 virtual const labelList& meshPoints() const
184 {
185 return meshPoints_;
186 }
187
188 //- Return constraints
189 virtual const List<pointConstraint>& constraints() const
190 {
191 return constraints_;
192 }
193
194 //- Return pointField of points in patch
195 virtual const pointField& localPoints() const;
196
197 //- Return point unit normals. Assumes single constraint
198 virtual const vectorField& pointNormals() const;
199
200 //- Write the pointPatch data as a dictionary
201 virtual void write(Ostream&) const;
202};
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207} // End namespace Foam
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211#endif
212
213// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual const pointField & localPoints() const
Return pointField of points in patch.
virtual label size() const
Return size.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
autoPtr< pointField > localPointsPtr_
Demand-driven local points.
autoPtr< pointField > pointNormalsPtr_
Demand-driven local normals (assumes constructed with pointNormals.
virtual const List< pointConstraint > & constraints() const
Return constraints.
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.
virtual ~meshPointPatch()=default
Destructor.
const List< pointConstraint > constraints_
virtual const labelList & meshPoints() const
Return mesh points.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
const labelList meshPoints_
Explicit mesh points.
virtual const vectorField & pointNormals() const
Return point unit normals. Assumes single constraint.
TypeName("meshPoint")
Runtime type information.
label index() const noexcept
The index of this patch in the boundaryMesh.
friend class pointBoundaryMesh
Definition pointPatch.H:81
pointPatch(const pointPatch &)=delete
No copy construct.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
Definition UList.H:75
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68