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 | Copyright (C) 2011-2012 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  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
68  pointPatch(const pointPatch&);
69 
70  //- Disallow default bitwise assignment
71  void operator=(const pointPatch&);
72 
73 
74 protected:
75 
76  // Protected Member Functions
77 
78  // The pointPatch geometry initialisation is called by pointBoundaryMesh
79  friend class pointBoundaryMesh;
80 
81  //- Initialise the calculation of the patch geometry
82  virtual void initGeometry(PstreamBuffers&)
83  {}
84 
85  //- Calculate the patch geometry
86  virtual void calcGeometry(PstreamBuffers&)
87  {}
88 
89  //- Initialise the patches for moving points
90  virtual void initMovePoints(PstreamBuffers&, const pointField&)
91  {}
92 
93  //- Correct patches after moving points
94  virtual void movePoints(PstreamBuffers&, const pointField&)
95  {}
96 
97  //- Initialise the update of the patch topology
98  virtual void initUpdateMesh(PstreamBuffers&)
99  {}
100 
101  //- Update of the patch topology
102  virtual void updateMesh(PstreamBuffers&)
103  {}
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("basePatch");
110 
111 
112  // Constructor
113 
115  (
116  const pointBoundaryMesh& bm
117  )
118  :
119  boundaryMesh_(bm)
120  {}
121 
122 
123  //- Destructor
124  virtual ~pointPatch()
125  {}
126 
127 
128  // Member Functions
129 
130  //- Return name
131  virtual const word& name() const = 0;
132 
133  //- Return size
134  virtual label size() const = 0;
135 
136  //- Return the index of this patch in the pointBoundaryMesh
137  virtual label index() const = 0;
138 
139  //- Return boundaryMesh reference
140  const pointBoundaryMesh& boundaryMesh() const
141  {
142  return boundaryMesh_;
143  }
144 
145  //- Return true if this patch field is coupled
146  virtual bool coupled() const
147  {
148  return false;
149  }
150 
151  //- Return mesh points
152  virtual const labelList& meshPoints() const = 0;
153 
154  //- Return mesh points
155  virtual const vectorField& localPoints() const = 0;
156 
157  //- Return point normals
158  virtual const vectorField& pointNormals() const = 0;
159 
160  //- Return the constraint type this pointPatch implements.
161  virtual const word& constraintType() const
162  {
163  return word::null;
164  }
165 
166  //- Accumulate the effect of constraint direction of this patch
167  virtual void applyConstraint
168  (
169  const label pointi,
171  ) const
172  {}
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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:101
virtual bool coupled() const
Return true if this patch field is coupled.
Definition: pointPatch.H:145
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: pointPatch.H:85
virtual void applyConstraint(const label pointi, pointConstraint &) const
Accumulate the effect of constraint direction of this patch.
Definition: pointPatch.H:167
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: pointPatch.H:97
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
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:89
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
Definition: pointPatch.H:160
TypeName("basePatch")
Runtime type information.
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:139
virtual const vectorField & localPoints() const =0
Return mesh points.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: pointPatch.H:81
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:123
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: pointPatch.H:93
Namespace for OpenFOAM.
virtual const labelList & meshPoints() const =0
Return mesh points.
virtual label size() const =0
Return size.