mappedWallPolyPatch.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::mappedWallPolyPatch
26 
27 Description
28  Determines a mapping between patch face centres and mesh cell or face
29  centres and processors they're on.
30 
31 Note
32  Storage is not optimal. It stores all face centres and cells on all
33  processors to keep the addressing calculation simple.
34 
35 SourceFiles
36  mappedWallPolyPatch.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef mappedWallPolyPatch_H
41 #define mappedWallPolyPatch_H
42 
43 #include "wallPolyPatch.H"
44 #include "mappedPatchBase.H"
45 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class polyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class mappedWallPolyPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public wallPolyPatch,
61  public mappedPatchBase
62 {
63 
64 protected:
65 
66  //- Initialise the calculation of the patch geometry
67  virtual void initGeometry(PstreamBuffers&);
68 
69  //- Calculate the patch geometry
70  virtual void calcGeometry(PstreamBuffers&);
71 
72  //- Initialise the patches for moving points
73  virtual void initMovePoints(PstreamBuffers&, const pointField&);
74 
75  //- Correct patches after moving points
76  virtual void movePoints(PstreamBuffers&, const pointField&);
77 
78  //- Initialise the update of the patch topology
79  virtual void initUpdateMesh(PstreamBuffers&);
80 
81  //- Update of the patch topology
82  virtual void updateMesh(PstreamBuffers&);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("mappedWall");
89 
90 
91  // Constructors
92 
93  //- Construct from components
95  (
96  const word& name,
97  const label size,
98  const label start,
99  const label index,
100  const polyBoundaryMesh& bm,
101  const word& patchType
102  );
103 
104  //- Construct from components
106  (
107  const word& name,
108  const label size,
109  const label start,
110  const label index,
111  const word& sampleRegion,
112  const mappedPatchBase::sampleMode mode,
113  const word& samplePatch,
114  const vectorField& offset,
115  const polyBoundaryMesh& bm
116  );
117 
118  //- Construct from components. Uniform offset.
120  (
121  const word& name,
122  const label size,
123  const label start,
124  const label index,
125  const word& sampleRegion,
126  const mappedPatchBase::sampleMode mode,
127  const word& samplePatch,
128  const vector& offset,
129  const polyBoundaryMesh& bm
130  );
131 
132  //- Construct from dictionary
134  (
135  const word& name,
136  const dictionary& dict,
137  const label index,
138  const polyBoundaryMesh& bm,
139  const word& patchType
140  );
141 
142  //- Construct as copy, resetting the boundary mesh
144  (
145  const mappedWallPolyPatch&,
146  const polyBoundaryMesh&
147  );
148 
149  //- Construct given the original patch and resetting the
150  // face list and boundary mesh information
152  (
153  const mappedWallPolyPatch& pp,
154  const polyBoundaryMesh& bm,
155  const label index,
156  const label newSize,
157  const label newStart
158  );
159 
160  //- Construct given the original patch and a map
162  (
163  const mappedWallPolyPatch& pp,
164  const polyBoundaryMesh& bm,
165  const label index,
166  const labelUList& mapAddressing,
167  const label newStart
168  );
169 
170  //- Construct and return a clone, resetting the boundary mesh
171  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
172  {
173  return autoPtr<polyPatch>(new mappedWallPolyPatch(*this, bm));
174  }
175 
176  //- Construct and return a clone, resetting the face list
177  // and boundary mesh
179  (
180  const polyBoundaryMesh& bm,
181  const label index,
182  const label newSize,
183  const label newStart
184  ) const
185  {
186  return autoPtr<polyPatch>
187  (
189  (
190  *this,
191  bm,
192  index,
193  newSize,
194  newStart
195  )
196  );
197  }
198 
199  //- Construct and return a clone, resetting the face list
200  // and boundary mesh
202  (
203  const polyBoundaryMesh& bm,
204  const label index,
205  const labelUList& mapAddressing,
206  const label newStart
207  ) const
208  {
209  return autoPtr<polyPatch>
210  (
212  (
213  *this,
214  bm,
215  index,
216  mapAddressing,
217  newStart
218  )
219  );
220  }
221 
222 
223  //- Destructor
224  virtual ~mappedWallPolyPatch();
225 
226 
227  // Member functions
228 
229  //- Write the polyPatch data as a dictionary
230  virtual void write(Ostream&) const;
231 };
232 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 } // End namespace Foam
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #endif
241 
242 // ************************************************************************* //
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:137
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
TypeName("mappedWall")
Runtime type information.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
A class for handling words, derived from string.
Definition: word.H:59
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
Foam::wallPolyPatch.
Definition: wallPolyPatch.H:48
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
mappedWallPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
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:61
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual ~mappedWallPolyPatch()
Destructor.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
sampleMode
Mesh items to sample.
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Namespace for OpenFOAM.