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