00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef polyPatch_H
00048 #define polyPatch_H
00049
00050 #include "patchIdentifier.H"
00051 #include "primitivePatch.H"
00052 #include "typeInfo.H"
00053 #include "runTimeSelectionTables.H"
00054
00055
00056
00057 namespace Foam
00058 {
00059
00060
00061
00062 class polyBoundaryMesh;
00063
00064
00065
00066
00067
00068 class polyPatch
00069 :
00070 public patchIdentifier,
00071 public primitivePatch
00072 {
00073
00074
00075
00076 label start_;
00077
00078
00079 const polyBoundaryMesh& boundaryMesh_;
00080
00081
00082
00083
00084
00085 mutable labelList::subList* faceCellsPtr_;
00086
00087
00088 mutable labelList* mePtr_;
00089
00090
00091
00092
00093
00094 void calcMeshEdges() const;
00095
00096
00097 protected:
00098
00099
00100
00101
00102 const pointField& allPoints() const;
00103
00104
00105 friend class polyBoundaryMesh;
00106
00107
00108 virtual void initGeometry()
00109 {}
00110
00111
00112 virtual void calcGeometry()
00113 {}
00114
00115
00116 virtual void initMovePoints(const pointField&)
00117 {}
00118
00119
00120 virtual void movePoints(const pointField& p);
00121
00122
00123 virtual void initUpdateMesh()
00124 {}
00125
00126
00127 virtual void updateMesh();
00128
00129
00130 public:
00131
00132
00133 TypeName("patch");
00134
00135
00136
00137
00138 declareRunTimeSelectionTable
00139 (
00140 autoPtr,
00141 polyPatch,
00142 word,
00143 (
00144 const word& name,
00145 const label size,
00146 const label start,
00147 const label index,
00148 const polyBoundaryMesh& bm
00149 ),
00150 (name, size, start, index, bm)
00151 );
00152
00153 declareRunTimeSelectionTable
00154 (
00155 autoPtr,
00156 polyPatch,
00157 Istream,
00158 (Istream& is, const label index, const polyBoundaryMesh& bm),
00159 (is, index, bm)
00160 );
00161
00162 declareRunTimeSelectionTable
00163 (
00164 autoPtr,
00165 polyPatch,
00166 dictionary,
00167 (
00168 const word& name,
00169 const dictionary& dict,
00170 const label index,
00171 const polyBoundaryMesh& bm
00172 ),
00173 (name, dict, index, bm)
00174 );
00175
00176
00177
00178
00179
00180 polyPatch
00181 (
00182 const word& name,
00183 const label size,
00184 const label start,
00185 const label index,
00186 const polyBoundaryMesh& bm
00187 );
00188
00189
00190 polyPatch(Istream&, const label index, const polyBoundaryMesh&);
00191
00192
00193 polyPatch
00194 (
00195 const word& name,
00196 const dictionary& dict,
00197 const label index,
00198 const polyBoundaryMesh& bm
00199 );
00200
00201
00202 polyPatch(const polyPatch&, const polyBoundaryMesh&);
00203
00204
00205
00206 polyPatch
00207 (
00208 const polyPatch& pp,
00209 const polyBoundaryMesh& bm,
00210 const label index,
00211 const label newSize,
00212 const label newStart
00213 );
00214
00215
00216 polyPatch(const polyPatch&);
00217
00218
00219 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00220 {
00221 return autoPtr<polyPatch>(new polyPatch(*this, bm));
00222 }
00223
00224
00225
00226 virtual autoPtr<polyPatch> clone
00227 (
00228 const polyBoundaryMesh& bm,
00229 const label index,
00230 const label newSize,
00231 const label newStart
00232 ) const
00233 {
00234 return autoPtr<polyPatch>
00235 (
00236 new polyPatch(*this, bm, index, newSize, newStart)
00237 );
00238 }
00239
00240
00241
00242
00243
00244
00245 static autoPtr<polyPatch> New
00246 (
00247 const word& patchType,
00248 const word& name,
00249 const label size,
00250 const label start,
00251 const label index,
00252 const polyBoundaryMesh& bm
00253 );
00254
00255
00256 static autoPtr<polyPatch> New
00257 (
00258 Istream&,
00259 const label index,
00260 const polyBoundaryMesh& bm
00261 );
00262
00263
00264
00265 static autoPtr<polyPatch> New
00266 (
00267 const word& name,
00268 const dictionary& dict,
00269 const label index,
00270 const polyBoundaryMesh& bm
00271 );
00272
00273
00274
00275
00276 virtual ~polyPatch();
00277
00278
00279
00280
00281
00282 label start() const
00283 {
00284 return start_;
00285 }
00286
00287
00288 const polyBoundaryMesh& boundaryMesh() const;
00289
00290
00291 virtual bool coupled() const
00292 {
00293 return false;
00294 }
00295
00296
00297 static bool constraintType(const word& pt);
00298
00299
00300 static wordList constraintTypes();
00301
00302
00303 template<class T>
00304 const typename List<T>::subList patchSlice(const List<T>& l) const
00305 {
00306 return typename List<T>::subList(l, this->size(), start_);
00307 }
00308
00309
00310 template<class T>
00311 const typename Field<T>::subField patchSlice(const Field<T>& l) const
00312 {
00313 return typename Field<T>::subField(l, this->size(), start_);
00314 }
00315
00316
00317
00318 virtual void write(Ostream&) const;
00319
00320
00321 virtual void writeDict(Ostream&) const;
00322
00323
00324
00325
00326
00327 const vectorField::subField faceCentres() const;
00328
00329
00330 const vectorField::subField faceAreas() const;
00331
00332
00333 tmp<vectorField> faceCellCentres() const;
00334
00335
00336
00337
00338
00339 const unallocLabelList& faceCells() const;
00340
00341
00342 const labelList& meshEdges() const;
00343
00344
00345 void clearAddressing();
00346
00347
00348
00349
00350
00351 inline label whichFace(const label l) const
00352 {
00353 return l - start_;
00354 }
00355
00356
00357
00358
00359 virtual void initOrder(const primitivePatch&) const;
00360
00361
00362
00363
00364
00365
00366 virtual bool order
00367 (
00368 const primitivePatch&,
00369 labelList& faceMap,
00370 labelList& rotation
00371 ) const;
00372
00373
00374
00375
00376
00377 void operator=(const polyPatch&);
00378
00379
00380
00381
00382 friend Ostream& operator<<(Ostream&, const polyPatch&);
00383 };
00384
00385
00386
00387
00388 }
00389
00390
00391
00392 #endif
00393
00394
Copyright © 2000-2007 OpenCFD Ltd