cyclicPointPatch.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-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::cyclicPointPatch
28 
29 Description
30  Cyclic patch for post-processing.
31 
32 SourceFiles
33  cyclicPointPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cyclicPointPatch_H
38 #define cyclicPointPatch_H
39 
40 #include "coupledFacePointPatch.H"
41 #include "cyclicPolyPatch.H"
42 #include "pointBoundaryMesh.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cyclicPointPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class cyclicPointPatch
54 :
56 {
57  // Private data
58 
59  //- Local reference cast into the cyclic patch
60  const cyclicPolyPatch& cyclicPolyPatch_;
61 
62 
63  // Private Member Functions
64 
65  //- No copy construct
66  cyclicPointPatch(const cyclicPointPatch&) = delete;
67 
68  //- No copy assignment
69  void operator=(const cyclicPointPatch&) = delete;
70 
71 
72  // Demand driven private data
73 
74  //- Initialise the calculation of the patch geometry
75  virtual void initGeometry(PstreamBuffers&);
76 
77  //- Calculate the patch geometry
78  virtual void calcGeometry(PstreamBuffers&);
79 
80  //- Initialise the patches for moving points
81  virtual void initMovePoints(PstreamBuffers&, const pointField&);
82 
83  //- Correct patches after moving points
84  virtual void movePoints(PstreamBuffers&, const pointField&);
85 
86  //- Initialise the update of the patch topology
87  virtual void initUpdateMesh(PstreamBuffers&);
88 
89  //- Update of the patch topology
90  virtual void updateMesh(PstreamBuffers&);
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName(cyclicPolyPatch::typeName_());
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const polyPatch& patch,
105  const pointBoundaryMesh& bm
106  );
107 
108  //- Construct given the original patch and a map
110  (
111  const cyclicPointPatch& patch,
112  const pointBoundaryMesh& bm,
113  const label index,
114  const labelUList& mapAddressing,
115  const labelUList& reversePointMap
116  );
117 
118  //- Construct and return a subset clone,
119  //- resetting the point list and boundary mesh
120  virtual autoPtr<pointPatch> clone
121  (
122  const pointBoundaryMesh& bm,
123  const label index,
124  const labelUList& mapAddressing,
125  const labelUList& reversePointMap
126  ) const
127  {
129  (
130  *this,
131  bm,
132  index,
133  mapAddressing,
134  reversePointMap
135  );
136  }
137 
138 
139  //- Destructor
140  virtual ~cyclicPointPatch();
141 
143  // Member Functions
144 
145  // Access
146 
147  //- Return the constraint type this pointPatch implements.
148  virtual const word& constraintType() const
149  {
150  return type();
151  }
152 
153  //- Return the underlying cyclicPolyPatch
154  const cyclicPolyPatch& cyclicPatch() const
155  {
156  return cyclicPolyPatch_;
157  }
158 
159  //- Return neighbour point patch
160  const cyclicPointPatch& neighbPatch() const
161  {
162  label patchi = cyclicPolyPatch_.neighbPatchID();
163  const pointPatch& pp = this->boundaryMesh()[patchi];
164  return refCast<const cyclicPointPatch>(pp);
165  }
166 
167  //- Are the cyclic planes parallel
168  bool parallel() const
169  {
170  return cyclicPolyPatch_.parallel();
171  }
172 
173  //- Return face transformation tensor
174  const tensorField& forwardT() const
175  {
176  return cyclicPolyPatch_.forwardT();
177  }
178 
179  //- Return neighbour-cell transformation tensor
180  const tensorField& reverseT() const
181  {
182  return cyclicPolyPatch_.reverseT();
183  }
184 
185 
186  // Access functions for demand driven data
187 
188  //- Return the set of pairs of points that require transformation
189  // and/or mapping. First index is on this patch, second on the
190  // neighbour patch.
191  virtual const edgeList& transformPairs() const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************************************************************* //
pointPatch(const pointPatch &)=delete
No copy construct.
A pointBoundaryMesh is a pointPatch list with registered IO, a reference to the associated pointMesh...
TypeName(cyclicPolyPatch::typeName_())
Runtime type information.
coupled patch for post-processing. Used as the base class for processor and cyclic pointPatches ...
virtual const polyPatch & patch() const
Return the polyPatch.
const cyclicPolyPatch & cyclicPatch() const
Return the underlying cyclicPolyPatch.
virtual ~cyclicPointPatch()
Destructor.
const tensorField & forwardT() const
Return face transformation tensor.
Cyclic patch for post-processing.
virtual label index() const
Return the index of this patch in the pointBoundaryMesh.
virtual const tensorField & forwardT() const
Return face transformation tensor.
virtual bool parallel() const
Are the cyclic planes parallel.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:801
A class for handling words, derived from Foam::string.
Definition: word.H:63
Cyclic plane patch.
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.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
const pointBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: pointPatch.H:250
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
virtual label neighbPatchID() const
Neighbour patchID.
virtual const edgeList & transformPairs() const
Return the set of pairs of points that require transformation.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
const cyclicPointPatch & neighbPatch() const
Return neighbour point patch.
bool parallel() const
Are the cyclic planes parallel.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.