regionCoupledPolyPatch.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-2020 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::regionCoupledPolyPatch
26 
27 Description
28  Region coupled polyPatch
29 
30 SourceFiles
31  regionCoupledPolyPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef regionCoupledPolyPatch_H
36 #define regionCoupledPolyPatch_H
37 
38 #include "regionCoupledBase.H"
39 #include "polyBoundaryMesh.H"
40 #include "polyPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class regionCoupledPolyPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public polyPatch,
54  public regionCoupledBase
55 {
56 
57 protected:
58 
59  // Protected Member Functions
60 
61  //- Initialise the calculation of the patch geometry
62  virtual void initCalcGeometry(PstreamBuffers&);
63 
64  //- Initialise the patches for moving points
65  virtual void initMovePoints(PstreamBuffers& pBufs, const pointField&);
66 
67  //- Correct patches after moving points
68  virtual void movePoints(PstreamBuffers& pBufs, const pointField&);
69 
70  //- Initialise the update of the patch topology
71  virtual void initUpdateMesh(PstreamBuffers&);
72 
73  //- Update of the patch topology
74  virtual void updateMesh(PstreamBuffers&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("regionCoupled");
81 
82 
83  // Constructors
84 
85  //- Construct from (base couped patch) components
87  (
88  const word& name,
89  const label size,
90  const label start,
91  const label index,
92  const polyBoundaryMesh& bm,
93  const word& patchType
94  );
95 
96  //- Construct from dictionary
98  (
99  const word& name,
100  const dictionary& dict,
101  const label index,
102  const polyBoundaryMesh& bm,
103  const word& patchType
104  );
105 
106  //- Construct as copy, resetting the boundary mesh
108  (
109  const regionCoupledPolyPatch&,
110  const polyBoundaryMesh&
111  );
112 
113  //- Construct given the original patch and resetting the
114  // face list and boundary mesh information
116  (
117  const regionCoupledPolyPatch& pp,
118  const polyBoundaryMesh& bm,
119  const label index,
120  const label newSize,
121  const label newStart
122  );
123 
124  //- Construct given the original patch and a map
126  (
127  const regionCoupledPolyPatch& pp,
128  const polyBoundaryMesh& bm,
129  const label index,
130  const labelUList& mapAddressing,
131  const label newStart
132  );
133 
134 
135  //- Construct and return a clone, resetting the boundary mesh
136  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
137  {
138  return autoPtr<polyPatch>(new regionCoupledPolyPatch(*this, bm));
139  }
140 
141  //- Construct and return a clone, resetting the face list
142  // and boundary mesh
144  (
145  const polyBoundaryMesh& bm,
146  const label index,
147  const label newSize,
148  const label newStart
149  ) const
150  {
151  return autoPtr<polyPatch>
152  (
154  (
155  *this,
156  bm,
157  index,
158  newSize,
159  newStart
160  )
161  );
162  }
163 
164  //- Construct and return a clone, resetting the face list
165  // and boundary mesh
167  (
168  const polyBoundaryMesh& bm,
169  const label index,
170  const labelUList& mapAddressing,
171  const label newStart
172  ) const
173  {
174  return autoPtr<polyPatch>
175  (
177  (
178  *this,
179  bm,
180  index,
181  mapAddressing,
182  newStart
183  )
184  );
185  }
186 
187 
188  //- Destructor
189  virtual ~regionCoupledPolyPatch();
190 
191 
192  // Member Functions
193 
194  // Access
195 
196  //- Is it coupled?
197  virtual bool coupled() const
198  {
199  return false;
200  }
201 
202 
203  //- Return the type
204  virtual const word& regionCoupleType() const
205  {
206  return type();
207  }
208 
209 
210  //- Write the polyPatch data as a dictionary
211  virtual void write(Ostream&) const;
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Base class with common functionality for regionCoupled polyPatch. It includes AMI.
virtual const word & regionCoupleType() const
Return the type.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual bool coupled() const
Is it coupled?
virtual autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
virtual ~regionCoupledPolyPatch()
Destructor.
TypeName("regionCoupled")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
virtual void initMovePoints(PstreamBuffers &pBufs, const pointField &)
Initialise the patches for moving points.
regionCoupledPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from (base couped patch) components.
virtual void movePoints(PstreamBuffers &pBufs, const pointField &)
Correct patches after moving points.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Region coupled polyPatch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Namespace for OpenFOAM.