FreeFOAM The Cross-Platform CFD Toolkit
directMappedWallPolyPatch.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) 1991-2010 OpenCFD Ltd.
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::directMappedWallPolyPatch
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  directMappedWallPolyPatch.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef directMappedWallPolyPatch_H
41 #define directMappedWallPolyPatch_H
42 
43 #include <OpenFOAM/wallPolyPatch.H>
44 #include "directMappedPatchBase.H"
45 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class polyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class directMappedWallPolyPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public wallPolyPatch,
62 {
63 
64 protected:
65 
66  //- Initialise the calculation of the patch geometry
67  virtual void initGeometry();
68 
69  //- Calculate the patch geometry
70  virtual void calcGeometry();
71 
72  //- Initialise the patches for moving points
73  virtual void initMovePoints(const pointField&);
74 
75  //- Correct patches after moving points
76  virtual void movePoints(const pointField&);
77 
78  //- Initialise the update of the patch topology
79  virtual void initUpdateMesh();
80 
81  //- Update of the patch topology
82  virtual void updateMesh();
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("directMappedWall");
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  );
102 
103  //- Construct from components
105  (
106  const word& name,
107  const label size,
108  const label start,
109  const label index,
110  const word& sampleRegion,
112  const word& samplePatch,
113  const vectorField& offset,
114  const polyBoundaryMesh& bm
115  );
116 
117  //- Construct from components. Uniform offset.
119  (
120  const word& name,
121  const label size,
122  const label start,
123  const label index,
124  const word& sampleRegion,
126  const word& samplePatch,
127  const vector& offset,
128  const polyBoundaryMesh& bm
129  );
130 
131  //- Construct from dictionary
133  (
134  const word& name,
135  const dictionary& dict,
136  const label index,
137  const polyBoundaryMesh& bm
138  );
139 
140  //- Construct as copy, resetting the boundary mesh
142  (
144  const polyBoundaryMesh&
145  );
146 
147  //- Construct given the original patch and resetting the
148  // face list and boundary mesh information
150  (
151  const directMappedWallPolyPatch& pp,
152  const polyBoundaryMesh& bm,
153  const label index,
154  const label newSize,
155  const label newStart
156  );
157 
158  //- Construct and return a clone, resetting the boundary mesh
159  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
160  {
161  return autoPtr<polyPatch>(new directMappedWallPolyPatch(*this, bm));
162  }
163 
164  //- Construct and return a clone, resetting the face list
165  // and boundary mesh
166  virtual autoPtr<polyPatch> clone
167  (
168  const polyBoundaryMesh& bm,
169  const label index,
170  const label newSize,
171  const label newStart
172  ) const
173  {
174  return autoPtr<polyPatch>
175  (
177  (
178  *this,
179  bm,
180  index,
181  newSize,
182  newStart
183  )
184  );
185  }
186 
187 
188  //- Destructor
189  virtual ~directMappedWallPolyPatch();
190 
191 
192  // Member functions
193 
194  //- Write the polyPatch data as a dictionary
195  virtual void write(Ostream&) const;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************ vim: set sw=4 sts=4 et: ************************ //