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