pointPatch.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-2026 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::pointPatch
26 
27 Description
28  Basic pointPatch represents a set of points from the mesh.
29 
30 SourceFiles
31  pointPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pointPatch_H
36 #define pointPatch_H
37 
38 #include "labelList.H"
39 #include "vectorField.H"
40 #include "pointField.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 
49 class objectRegistry;
50 class Time;
51 class pointMesh;
52 class pointBoundaryMesh;
53 class pointConstraint;
54 class PstreamBuffers;
55 class polyPatch;
56 
57 /*---------------------------------------------------------------------------*\
58  Class pointPatch Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class pointPatch
62 {
63  // Private Data
64 
65  //- Reference to boundary mesh
66  const pointBoundaryMesh& boundaryMesh_;
67 
68 
69 protected:
70 
71  // Protected Member Functions
72 
73  // The pointPatch geometry initialisation is called by pointBoundaryMesh
74  friend class pointBoundaryMesh;
75 
76  //- Initialise the calculation of the patch geometry
77  virtual void initCalcGeometry(PstreamBuffers&)
78  {}
79 
80  //- Calculate the patch geometry
81  virtual void calcGeometry(PstreamBuffers&)
82  {}
83 
84  //- Initialise the patches for moving points
85  virtual void initMovePoints(PstreamBuffers&, const pointField&)
86  {}
87 
88  //- Correct patches after moving points
89  virtual void movePoints(PstreamBuffers&, const pointField&)
90  {}
91 
92  //- Initialise the update of the patch topology
93  virtual void initTopoChange(PstreamBuffers&)
94  {}
95 
96  //- Update of the patch topology
97  virtual void topoChange(PstreamBuffers&)
98  {}
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("basePatch");
105 
106 
107  // Constructor
108 
109  pointPatch(const pointBoundaryMesh& bm)
110  :
111  boundaryMesh_(bm)
112  {}
113 
114  //- Disallow default bitwise copy construction
115  pointPatch(const pointPatch&) = delete;
116 
117 
118  //- Destructor
119  virtual ~pointPatch()
120  {}
121 
122 
123  // Member Functions
124 
125  //- Return the polyPatch
126  const polyPatch& poly() const;
127 
128  //- Return name
129  virtual const word& name() const = 0;
130 
131  //- Return size
132  virtual label size() const = 0;
133 
134  //- Return the index of this patch in the pointBoundaryMesh
135  virtual label index() const = 0;
136 
137  //- Return the local object registry
138  const objectRegistry& db() const;
139 
140  //- Return mesh reference
141  const pointMesh& mesh() const;
142 
143  //- Return time
144  const Time& time() const;
145 
146  //- Return boundaryMesh reference
147  const pointBoundaryMesh& boundaryMesh() const
148  {
149  return boundaryMesh_;
150  }
151 
152  //- Return true if this patch is a constraint type
153  virtual bool constraint() const;
154 
155  //- Return true if this patch field is coupled
156  virtual bool coupled() const
157  {
158  return false;
159  }
160 
161  //- Return mesh points
162  virtual const labelList& meshPoints() const = 0;
163 
164  //- Return mesh points
165  virtual const vectorField& localPoints() const = 0;
166 
167  //- Return point normals
168  virtual const vectorField& pointNormals() const = 0;
169 
170  //- Accumulate the effect of constraint direction of this patch
171  virtual void applyConstraint
172  (
173  const label pointi,
175  ) const
176  {}
177 
178 
179  // Member Operators
180 
181  //- Disallow default bitwise assignment
182  void operator=(const pointPatch&) = delete;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Registry of regIOobjects.
Foam::pointBoundaryMesh.
Accumulates point constraints through successive applications of the applyConstraint function.
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:52
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:61
const polyPatch & poly() const
Return the polyPatch.
Definition: pointPatch.C:39
virtual const word & name() const =0
Return name.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: pointPatch.H:88
virtual ~pointPatch()
Destructor.
Definition: pointPatch.H:118
const Time & time() const
Return time.
Definition: pointPatch.C:57
virtual void applyConstraint(const label pointi, pointConstraint &) const
Accumulate the effect of constraint direction of this patch.
Definition: pointPatch.H:171
virtual const vectorField & pointNormals() const =0
Return point normals.
virtual bool coupled() const
Return true if this patch field is coupled.
Definition: pointPatch.H:155
virtual const labelList & meshPoints() const =0
Return mesh points.
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
Definition: pointPatch.H:96
const objectRegistry & db() const
Return the local object registry.
Definition: pointPatch.C:45
virtual label index() const =0
Return the index of this patch in the pointBoundaryMesh.
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: pointPatch.H:146
pointPatch(const pointBoundaryMesh &bm)
Definition: pointPatch.H:108
virtual const vectorField & localPoints() const =0
Return mesh points.
virtual bool constraint() const
Return true if this patch is a constraint type.
Definition: pointPatch.C:63
TypeName("basePatch")
Runtime type information.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: pointPatch.H:76
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: pointPatch.H:92
virtual label size() const =0
Return size.
void operator=(const pointPatch &)=delete
Disallow default bitwise assignment.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: pointPatch.H:80
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: pointPatch.H:84
const pointMesh & mesh() const
Return mesh reference.
Definition: pointPatch.C:51
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
A class for handling words, derived from string.
Definition: word.H:63
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