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* mePtr_;
00086
00087
00088
00089
00090
00091 void calcMeshEdges() const;
00092
00093
00094 protected:
00095
00096
00097
00098
00099 const pointField& allPoints() const;
00100
00101
00102 friend class polyBoundaryMesh;
00103
00104
00105 virtual void initGeometry()
00106 {}
00107
00108
00109 virtual void calcGeometry()
00110 {}
00111
00112
00113 virtual void initMovePoints(const pointField&)
00114 {}
00115
00116
00117 virtual void movePoints(const pointField& p);
00118
00119
00120 virtual void initUpdateTopology()
00121 {}
00122
00123
00124 virtual void updateMesh();
00125
00126
00127 public:
00128
00129
00130 TypeName("patch");
00131
00132
00133
00134
00135 declareRunTimeSelectionTable
00136 (
00137 autoPtr,
00138 polyPatch,
00139 word,
00140 (
00141 const word& name,
00142 const label size,
00143 const label start,
00144 const label index,
00145 const polyBoundaryMesh& bm
00146 ),
00147 (name, size, start, index, bm)
00148 );
00149
00150 declareRunTimeSelectionTable
00151 (
00152 autoPtr,
00153 polyPatch,
00154 Istream,
00155 (Istream& is, const label index, const polyBoundaryMesh& bm),
00156 (is, index, bm)
00157 );
00158
00159 declareRunTimeSelectionTable
00160 (
00161 autoPtr,
00162 polyPatch,
00163 dictionary,
00164 (
00165 const word& name,
00166 const dictionary& dict,
00167 const label index,
00168 const polyBoundaryMesh& bm
00169 ),
00170 (name, dict, index, bm)
00171 );
00172
00173
00174
00175
00176
00177 polyPatch
00178 (
00179 const word& name,
00180 const label size,
00181 const label start,
00182 const label index,
00183 const polyBoundaryMesh& bm
00184 );
00185
00186
00187 polyPatch(Istream&, const label index, const polyBoundaryMesh&);
00188
00189
00190 polyPatch
00191 (
00192 const word& name,
00193 const dictionary& dict,
00194 const label index,
00195 const polyBoundaryMesh& bm
00196 );
00197
00198
00199 polyPatch(const polyPatch&, const polyBoundaryMesh&);
00200
00201
00202
00203 polyPatch
00204 (
00205 const polyPatch& pp,
00206 const polyBoundaryMesh& bm,
00207 const label index,
00208 const label newSize,
00209 const label newStart
00210 );
00211
00212
00213 polyPatch(const polyPatch&);
00214
00215
00216 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00217 {
00218 return autoPtr<polyPatch>(new polyPatch(*this, bm));
00219 }
00220
00221
00222
00223 virtual autoPtr<polyPatch> clone
00224 (
00225 const polyBoundaryMesh& bm,
00226 const label index,
00227 const label newSize,
00228 const label newStart
00229 ) const
00230 {
00231 return autoPtr<polyPatch>
00232 (
00233 new polyPatch(*this, bm, index, newSize, newStart)
00234 );
00235 }
00236
00237
00238
00239
00240
00241
00242 static autoPtr<polyPatch> New
00243 (
00244 const word& patchType,
00245 const word& name,
00246 const label size,
00247 const label start,
00248 const label index,
00249 const polyBoundaryMesh& bm
00250 );
00251
00252
00253 static autoPtr<polyPatch> New
00254 (
00255 Istream&,
00256 const label index,
00257 const polyBoundaryMesh& bm
00258 );
00259
00260
00261
00262 static autoPtr<polyPatch> New
00263 (
00264 const word& name,
00265 const dictionary& dict,
00266 const label index,
00267 const polyBoundaryMesh& bm
00268 );
00269
00270
00271
00272
00273 virtual ~polyPatch();
00274
00275
00276
00277
00278
00279 label start() const
00280 {
00281 return start_;
00282 }
00283
00284
00285 const polyBoundaryMesh& boundaryMesh() const;
00286
00287
00288 virtual bool coupled() const
00289 {
00290 return false;
00291 }
00292
00293
00294 static bool constraintType(const word& pt);
00295
00296
00297 static wordList constraintTypes();
00298
00299
00300 template<class T>
00301 const typename List<T>::subList patchSlice(const List<T>& l) const
00302 {
00303 return typename List<T>::subList(l, this->size(), start_);
00304 }
00305
00306
00307 template<class T>
00308 const typename Field<T>::subField patchSlice(const Field<T>& l) const
00309 {
00310 return typename Field<T>::subField(l, this->size(), start_);
00311 }
00312
00313
00314
00315 virtual void write(Ostream&) const;
00316
00317
00318 virtual void writeDict(Ostream&) const;
00319
00320
00321
00322
00323
00324 const vectorField::subField faceCentres() const;
00325
00326
00327 const vectorField::subField faceAreas() const;
00328
00329
00330 tmp<vectorField> faceCellCentres() const;
00331
00332
00333
00334
00335
00336 const labelList::subList faceCells() const;
00337
00338
00339 const labelList& meshEdges() const;
00340
00341
00342 void clearAddressing();
00343
00344
00345
00346
00347
00348 inline label whichFace(const label l) const
00349 {
00350 return l - start_;
00351 }
00352
00353
00354
00355
00356 virtual void initOrder(const primitivePatch&) const;
00357
00358
00359
00360
00361
00362
00363 virtual bool order
00364 (
00365 const primitivePatch&,
00366 labelList& faceMap,
00367 labelList& rotation
00368 ) const;
00369
00370
00371
00372
00373
00374 void operator=(const polyPatch&);
00375
00376
00377
00378
00379 friend Ostream& operator<<(Ostream&, const polyPatch&);
00380 };
00381
00382
00383
00384
00385 }
00386
00387
00388
00389 #endif
00390
00391