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 #ifndef polyMesh_H
00042 #define polyMesh_H
00043
00044 #include "objectRegistry.H"
00045 #include "primitiveMesh.H"
00046 #include "pointField.H"
00047 #include "faceList.H"
00048 #include "cellList.H"
00049 #include "cellShapeList.H"
00050 #include "pointIOField.H"
00051 #include "faceIOList.H"
00052 #include "labelIOList.H"
00053 #include "polyBoundaryMesh.H"
00054 #include "boundBox.H"
00055 #include "pointZoneMesh.H"
00056 #include "faceZoneMesh.H"
00057 #include "cellZoneMesh.H"
00058
00059
00060
00061 namespace Foam
00062 {
00063
00064 class globalMeshData;
00065 class mapPolyMesh;
00066
00067
00068
00069
00070
00071 class polyMesh
00072 :
00073 public objectRegistry,
00074 public primitiveMesh
00075 {
00076
00077 public:
00078
00079
00080
00081
00082
00083
00084
00085 enum readUpdateState
00086 {
00087 UNCHANGED,
00088 POINTS_MOVED,
00089 TOPO_CHANGE,
00090 TOPO_PATCH_CHANGE
00091 };
00092
00093
00094 private:
00095
00096
00097
00098
00099
00100
00101 pointIOField points_;
00102
00103
00104 faceIOList faces_;
00105
00106
00107 labelIOList allOwner_;
00108
00109
00110 labelIOList allNeighbour_;
00111
00112
00113 mutable polyBoundaryMesh boundary_;
00114
00115
00116
00117 boundBox bounds_;
00118
00119
00120
00121 mutable Vector<label> directions_;
00122
00123
00124
00125
00126
00127 pointZoneMesh pointZones_;
00128
00129
00130 faceZoneMesh faceZones_;
00131
00132
00133 cellZoneMesh cellZones_;
00134
00135
00136
00137 mutable globalMeshData* globalMeshDataPtr_;
00138
00139
00140
00141
00142
00143 bool moving_;
00144
00145
00146 mutable label curMotionTimeIndex_;
00147
00148
00149 mutable pointField* oldPointsPtr_;
00150
00151
00152
00153
00154
00155 polyMesh(const polyMesh&);
00156
00157
00158 void operator=(const polyMesh&);
00159
00160
00161 void initMesh();
00162
00163
00164 void initMesh(cellList& c);
00165
00166
00167 void calcDirections() const;
00168
00169
00170
00171 void calcCellShapes() const;
00172
00173
00174
00175
00176 labelListList cellShapePointCells(const cellShapeList&) const;
00177
00178 labelList facePatchFaceCells
00179 (
00180 const faceList& patchFaces,
00181 const labelListList& pointCells,
00182 const faceListList& cellsFaceShapes,
00183 const label patchID
00184 ) const;
00185
00186
00187 public:
00188
00189
00190
00191 typedef polyMesh Mesh;
00192 typedef polyBoundaryMesh BoundaryMesh;
00193
00194
00195
00196 TypeName("polyMesh");
00197
00198
00199 static word defaultRegion;
00200
00201
00202 static word meshSubDir;
00203
00204
00205
00206
00207
00208 explicit polyMesh(const IOobject& io);
00209
00210
00211
00212 polyMesh
00213 (
00214 const IOobject& io,
00215 const pointField& points,
00216 const faceList& faces,
00217 const labelList& allOwner,
00218 const labelList& allNeighbour,
00219 const bool syncPar = true
00220 );
00221
00222
00223
00224
00225 polyMesh
00226 (
00227 const IOobject& io,
00228 const pointField& points,
00229 const faceList& faces,
00230 const cellList& cells,
00231 const bool syncPar = true
00232 );
00233
00234
00235 polyMesh
00236 (
00237 const IOobject& io,
00238 const pointField& points,
00239 const cellShapeList& shapes,
00240 const faceListList& boundaryFaces,
00241 const wordList& boundaryPatchNames,
00242 const wordList& boundaryPatchTypes,
00243 const word& defaultBoundaryPatchType,
00244 const wordList& boundaryPatchPhysicalTypes,
00245 const bool syncPar = true
00246 );
00247
00248
00249
00250
00251 virtual ~polyMesh();
00252
00253
00254
00255
00256
00257
00258
00259
00260 virtual const fileName& dbDir() const;
00261
00262
00263 fileName meshDir() const;
00264
00265
00266
00267
00268 const fileName& pointsInstance() const;
00269
00270
00271 const fileName& facesInstance() const;
00272
00273
00274 void setInstance(const fileName&);
00275
00276
00277
00278
00279
00280 const pointField& allPoints() const;
00281
00282
00283 const faceList& allFaces() const;
00284
00285
00286 const pointField& oldAllPoints() const;
00287
00288
00289 const labelList& allOwner() const;
00290
00291
00292 const labelList& allNeighbour() const;
00293
00294
00295 const polyBoundaryMesh& boundaryMesh() const
00296 {
00297 return boundary_;
00298 }
00299
00300
00301 const boundBox& bounds() const
00302 {
00303 return bounds_;
00304 }
00305
00306
00307
00308
00309 const Vector<label>& directions() const;
00310
00311
00312 label nGeometricD() const;
00313
00314
00315
00316
00317 label nSolutionD() const;
00318
00319
00320 const pointZoneMesh& pointZones() const
00321 {
00322 return pointZones_;
00323 }
00324
00325
00326 const faceZoneMesh& faceZones() const
00327 {
00328 return faceZones_;
00329 }
00330
00331
00332 const cellZoneMesh& cellZones() const
00333 {
00334 return cellZones_;
00335 }
00336
00337
00338 const globalMeshData& globalData() const;
00339
00340
00341
00342
00343
00344 bool moving() const
00345 {
00346 return moving_;
00347 }
00348
00349
00350 void setMoving()
00351 {
00352 moving_ = true;
00353 }
00354
00355
00356 virtual tmp<scalarField> movePoints(const pointField&);
00357
00358
00359 void resetMotion() const;
00360
00361
00362
00363
00364
00365 pointZoneMesh& pointZones()
00366 {
00367 return pointZones_;
00368 }
00369
00370
00371 faceZoneMesh& faceZones()
00372 {
00373 return faceZones_;
00374 }
00375
00376
00377 cellZoneMesh& cellZones()
00378 {
00379 return cellZones_;
00380 }
00381
00382
00383 void addPatches
00384 (
00385 const List<polyPatch*>&,
00386 const bool validBoundary = true
00387 );
00388
00389
00390 void addZones
00391 (
00392 const List<pointZone*>& pz,
00393 const List<faceZone*>& fz,
00394 const List<cellZone*>& cz
00395 );
00396
00397
00398
00399 virtual readUpdateState readUpdate();
00400
00401
00402 virtual void updateMesh(const mapPolyMesh& mpm);
00403
00404
00405 void removeBoundary();
00406
00407
00408
00409
00410
00411
00412 void resetPrimitives
00413 (
00414 const label nUsedFaces,
00415 const pointField& allPoints,
00416 const faceList& allFaces,
00417 const labelList& allOwner,
00418 const labelList& allNeighbour,
00419 const labelList& patchSizes,
00420 const labelList& patchStarts,
00421 const bool validBoundary = true
00422 );
00423
00424
00425
00426
00427
00428 void clearGeom();
00429
00430
00431 void clearAddressing();
00432
00433
00434 void clearOut();
00435
00436
00437 void clearPrimitives();
00438
00439
00440 void removeFiles(const fileName& instanceDir) const;
00441
00442
00443 void removeFiles() const;
00444 };
00445
00446
00447
00448
00449 }
00450
00451
00452
00453 #endif
00454
00455
Copyright © 2000-2007 OpenCFD Ltd