polyMesh.H
Go to the documentation of this file.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 owner_;
00108
00109
00110 labelIOList neighbour_;
00111
00112
00113 bool clearedPrimitives_;
00114
00115
00116
00117 mutable polyBoundaryMesh boundary_;
00118
00119
00120
00121 boundBox bounds_;
00122
00123
00124
00125 mutable Vector<label> geometricD_;
00126
00127
00128
00129 mutable Vector<label> solutionD_;
00130
00131
00132
00133
00134
00135 pointZoneMesh pointZones_;
00136
00137
00138 faceZoneMesh faceZones_;
00139
00140
00141 cellZoneMesh cellZones_;
00142
00143
00144
00145 mutable globalMeshData* globalMeshDataPtr_;
00146
00147
00148
00149
00150
00151 bool moving_;
00152
00153
00154 bool changing_;
00155
00156
00157 mutable label curMotionTimeIndex_;
00158
00159
00160 mutable pointField* oldPointsPtr_;
00161
00162
00163
00164
00165
00166 polyMesh(const polyMesh&);
00167
00168
00169 void operator=(const polyMesh&);
00170
00171
00172 void initMesh();
00173
00174
00175 void initMesh(cellList& c);
00176
00177
00178 void calcDirections() const;
00179
00180
00181
00182 void calcCellShapes() const;
00183
00184
00185
00186
00187 labelListList cellShapePointCells(const cellShapeList&) const;
00188
00189 labelList facePatchFaceCells
00190 (
00191 const faceList& patchFaces,
00192 const labelListList& pointCells,
00193 const faceListList& cellsFaceShapes,
00194 const label patchID
00195 ) const;
00196
00197
00198 public:
00199
00200
00201
00202 typedef polyMesh Mesh;
00203 typedef polyBoundaryMesh BoundaryMesh;
00204
00205
00206
00207 TypeName("polyMesh");
00208
00209
00210 static word defaultRegion;
00211
00212
00213 static word meshSubDir;
00214
00215
00216
00217
00218
00219 explicit polyMesh(const IOobject& io);
00220
00221
00222
00223 polyMesh
00224 (
00225 const IOobject& io,
00226 const Xfer<pointField>& points,
00227 const Xfer<faceList>& faces,
00228 const Xfer<labelList>& owner,
00229 const Xfer<labelList>& neighbour,
00230 const bool syncPar = true
00231 );
00232
00233
00234
00235 polyMesh
00236 (
00237 const IOobject& io,
00238 const Xfer<pointField>& points,
00239 const Xfer<faceList>& faces,
00240 const Xfer<cellList>& cells,
00241 const bool syncPar = true
00242 );
00243
00244
00245 polyMesh
00246 (
00247 const IOobject& io,
00248 const Xfer<pointField>& points,
00249 const cellShapeList& shapes,
00250 const faceListList& boundaryFaces,
00251 const wordList& boundaryPatchNames,
00252 const wordList& boundaryPatchTypes,
00253 const word& defaultBoundaryPatchName,
00254 const word& defaultBoundaryPatchType,
00255 const wordList& boundaryPatchPhysicalTypes,
00256 const bool syncPar = true
00257 );
00258
00259
00260
00261
00262 virtual ~polyMesh();
00263
00264
00265
00266
00267
00268
00269
00270 virtual const fileName& dbDir() const;
00271
00272
00273 fileName meshDir() const;
00274
00275
00276
00277
00278 const fileName& pointsInstance() const;
00279
00280
00281 const fileName& facesInstance() const;
00282
00283
00284 void setInstance(const fileName&);
00285
00286
00287
00288
00289
00290 virtual const pointField& points() const;
00291
00292
00293 virtual const faceList& faces() const;
00294
00295
00296 virtual const labelList& faceOwner() const;
00297
00298
00299 virtual const labelList& faceNeighbour() const;
00300
00301
00302 virtual const pointField& oldPoints() const;
00303
00304
00305 const polyBoundaryMesh& boundaryMesh() const
00306 {
00307 return boundary_;
00308 }
00309
00310
00311 const boundBox& bounds() const
00312 {
00313 return bounds_;
00314 }
00315
00316
00317
00318
00319
00320 const Vector<label>& geometricD() const;
00321
00322
00323 label nGeometricD() const;
00324
00325
00326
00327
00328
00329 const Vector<label>& solutionD() const;
00330
00331
00332 label nSolutionD() const;
00333
00334
00335 const pointZoneMesh& pointZones() const
00336 {
00337 return pointZones_;
00338 }
00339
00340
00341 const faceZoneMesh& faceZones() const
00342 {
00343 return faceZones_;
00344 }
00345
00346
00347 const cellZoneMesh& cellZones() const
00348 {
00349 return cellZones_;
00350 }
00351
00352
00353 const globalMeshData& globalData() const;
00354
00355
00356 const objectRegistry& thisDb() const
00357 {
00358 return *this;
00359 }
00360
00361
00362
00363
00364 bool moving() const
00365 {
00366 return moving_;
00367 }
00368
00369
00370 bool moving(const bool m)
00371 {
00372 bool m0 = moving_;
00373 moving_ = m;
00374 changing_ = changing_ || moving_;
00375 return m0;
00376 }
00377
00378
00379 bool changing() const
00380 {
00381 return changing_;
00382 }
00383
00384
00385 bool changing(const bool c)
00386 {
00387 bool c0 = changing_;
00388 changing_ = c;
00389 return c0;
00390 }
00391
00392
00393 virtual tmp<scalarField> movePoints(const pointField&);
00394
00395
00396 void resetMotion() const;
00397
00398
00399
00400
00401
00402 pointZoneMesh& pointZones()
00403 {
00404 return pointZones_;
00405 }
00406
00407
00408 faceZoneMesh& faceZones()
00409 {
00410 return faceZones_;
00411 }
00412
00413
00414 cellZoneMesh& cellZones()
00415 {
00416 return cellZones_;
00417 }
00418
00419
00420 void addPatches
00421 (
00422 const List<polyPatch*>&,
00423 const bool validBoundary = true
00424 );
00425
00426
00427 void addZones
00428 (
00429 const List<pointZone*>& pz,
00430 const List<faceZone*>& fz,
00431 const List<cellZone*>& cz
00432 );
00433
00434
00435
00436 virtual readUpdateState readUpdate();
00437
00438
00439 virtual void updateMesh(const mapPolyMesh& mpm);
00440
00441
00442 void removeBoundary();
00443
00444
00445
00446
00447
00448
00449 void resetPrimitives
00450 (
00451 const Xfer<pointField>& points,
00452 const Xfer<faceList>& faces,
00453 const Xfer<labelList>& owner,
00454 const Xfer<labelList>& neighbour,
00455 const labelList& patchSizes,
00456 const labelList& patchStarts,
00457 const bool validBoundary = true
00458 );
00459
00460
00461
00462
00463
00464 void clearGeom();
00465
00466
00467 void clearAddressing();
00468
00469
00470 void clearOut();
00471
00472
00473 void clearPrimitives();
00474
00475
00476 void removeFiles(const fileName& instanceDir) const;
00477
00478
00479 void removeFiles() const;
00480 };
00481
00482
00483
00484
00485 }
00486
00487
00488
00489 #endif
00490
00491
Copyright © 2000-2009 OpenCFD Ltd