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-2021 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 pointBoundaryMesh;
50 class pointConstraint;
51 class PstreamBuffers;
52 
53 /*---------------------------------------------------------------------------*\
54  Class pointPatch Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class pointPatch
58 {
59  // Private Data
60 
61  //- Reference to boundary mesh
62  const pointBoundaryMesh& boundaryMesh_;
63 
64 
65 protected:
66 
67  // Protected Member Functions
68 
69  // The pointPatch geometry initialisation is called by pointBoundaryMesh
70  friend class pointBoundaryMesh;
71 
72  //- Initialise the calculation of the patch geometry
73  virtual void initCalcGeometry(PstreamBuffers&)
74  {}
75 
76  //- Calculate the patch geometry
77  virtual void calcGeometry(PstreamBuffers&)
78  {}
79 
80  //- Initialise the patches for moving points
81  virtual void initMovePoints(PstreamBuffers&, const pointField&)
82  {}
83 
84  //- Correct patches after moving points
85  virtual void movePoints(PstreamBuffers&, const pointField&)
86  {}
87 
88  //- Initialise the update of the patch topology
89  virtual void initUpdateMesh(PstreamBuffers&)
90  {}
91 
92  //- Update of the patch topology
93  virtual void updateMesh(PstreamBuffers&)
94  {}
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("basePatch");
101 
102 
103  // Constructor
104 
106  (
107  const pointBoundaryMesh& bm
108  )
109  :
110  boundaryMesh_(bm)
111  {}
112 
113  //- Disallow default bitwise copy construction
114  pointPatch(const pointPatch&) = delete;
115 
116 
117  //- Destructor
118  virtual ~pointPatch()
119  {}
120 
121 
122  // Member Functions
123 
124  //- Return name
125  virtual const word& name() const = 0;
126 
127  //- Return size
128  virtual label size() const = 0;
129 
130  //- Return the index of this patch in the pointBoundaryMesh
131  virtual label index() const = 0;
132 
133  //- Return boundaryMesh reference
134  const pointBoundaryMesh& boundaryMesh() const
135  {
136  return boundaryMesh_;
137  }
138 
139  //- Return true if this patch field is coupled
140  virtual bool coupled() const
141  {
142  return false;
143  }
144 
145  //- Return mesh points
146  virtual const labelList& meshPoints() const = 0;
147 
148  //- Return mesh points
149  virtual const vectorField& localPoints() const = 0;
150 
151  //- Return point normals
152  virtual const vectorField& pointNormals() const = 0;
153 
154  //- Accumulate the effect of constraint direction of this patch
155  virtual void applyConstraint
156  (
157  const label pointi,
159  ) const
160  {}
161 
162 
163  // Member Operators
164 
165  //- Disallow default bitwise assignment
166  void operator=(const pointPatch&) = delete;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: pointPatch.H:72
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
Foam::pointBoundaryMesh.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Definition: pointPatch.H:92
virtual bool coupled() const
Return true if this patch field is coupled.
Definition: pointPatch.H:139
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: pointPatch.H:76
virtual void applyConstraint(const label pointi, pointConstraint &) const
Accumulate the effect of constraint direction of this patch.
Definition: pointPatch.H:155
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: pointPatch.H:88
A class for handling words, derived from string.
Definition: word.H:59
pointPatch(const pointBoundaryMesh &bm)
Definition: pointPatch.H:105
virtual const word & name() const =0
Return name.
Accumulates point constraints through successive applications of the applyConstraint function...
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: pointPatch.H:80
TypeName("basePatch")
Runtime type information.
void operator=(const pointPatch &)=delete
Disallow default bitwise assignment.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual const vectorField & pointNormals() const =0
Return point normals.
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: pointPatch.H:133
virtual const vectorField & localPoints() const =0
Return mesh points.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
virtual label index() const =0
Return the index of this patch in the pointBoundaryMesh.
virtual ~pointPatch()
Destructor.
Definition: pointPatch.H:117
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: pointPatch.H:84
Namespace for OpenFOAM.
virtual const labelList & meshPoints() const =0
Return mesh points.
virtual label size() const =0
Return size.