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