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 #ifndef faMesh_H
00038 #define faMesh_H
00039
00040 #include "faBoundaryMesh.H"
00041 #include "faProcTopology.H"
00042 #include "edgeList.H"
00043 #include "faceList.H"
00044 #include "primitiveFieldsFwd.H"
00045 #include "lduAddressing.H"
00046 #include "areaFieldsFwd.H"
00047 #include "edgeFieldsFwd.H"
00048 #include "indirectPrimitivePatch.H"
00049 #include "edgeInterpolation.H"
00050 #include "labelIOList.H"
00051 #include "scalarIOField.H"
00052 #include "FieldFields.H"
00053
00054
00055
00056 namespace Foam
00057 {
00058
00059
00060 class polyMesh;
00061 class lduAddressingFaMesh;
00062
00063
00064
00065
00066
00067 class faMesh
00068 :
00069 public edgeInterpolation
00070 {
00071
00072
00073
00074 const polyMesh& mesh_;
00075
00076
00077 labelIOList faceLabels_;
00078
00079
00080 faBoundaryMesh boundary_;
00081
00082
00083
00084
00085
00086 edgeList edges_;
00087
00088
00089 labelList edgeOwner_;
00090
00091
00092 labelList edgeNeighbour_;
00093
00094
00095
00096
00097
00098 mutable label nPoints_;
00099
00100
00101 mutable label nEdges_;
00102
00103
00104 mutable label nInternalEdges_;
00105
00106
00107 mutable label nFaces_;
00108
00109
00110
00111
00112
00113 mutable indirectPrimitivePatch* patchPtr_;
00114
00115
00116 mutable lduAddressingFaMesh* lduPtr_;
00117
00118
00119 mutable scalarField* SPtr_;
00120
00121
00122 mutable scalarIOField* S0Ptr_;
00123
00124
00125 mutable scalarIOField* S00Ptr_;
00126
00127
00128 mutable labelList* patchStartsPtr_;
00129
00130
00131 mutable edgeVectorField* LePtr_;
00132
00133
00134 mutable edgeScalarField* magLePtr_;
00135
00136
00137 mutable areaVectorField* centresPtr_;
00138
00139
00140 mutable edgeVectorField* edgeCentresPtr_;
00141
00142
00143 mutable areaVectorField* faceAreaNormalsPtr_;
00144
00145
00146 mutable edgeVectorField* edgeAreaNormalsPtr_;
00147
00148
00149 mutable vectorField* pointAreaNormalsPtr_;
00150
00151
00152 mutable areaScalarField* faceCurvaturesPtr_;
00153
00154
00155 mutable FieldField<Field, tensor>* edgeTransformTensorsPtr_;
00156
00157
00158
00159
00160
00161 mutable faProcTopology* parallelDataPtr_;
00162
00163
00164
00165
00166 bool moving_;
00167
00168
00169 mutable label curMotionTimeIndex_;
00170
00171
00172
00173
00174
00175 faMesh(const faMesh&);
00176
00177
00178 void operator=(const faMesh&);
00179
00180
00181 void setPrimitiveMeshData();
00182
00183
00184
00185
00186 void calcLduAddressing() const;
00187
00188
00189 void calcPatchStarts() const;
00190
00191
00192 void calcLe() const;
00193
00194
00195 void calcMagLe() const;
00196
00197
00198 void calcCentres() const;
00199
00200
00201 void calcEdgeCentres() const;
00202
00203
00204 void calcS() const;
00205
00206
00207 void calcFaceAreaNormals() const;
00208
00209
00210 void calcEdgeAreaNormals() const;
00211
00212
00213 void calcPointAreaNormals() const;
00214
00215
00216 void calcFaceCurvatures() const;
00217
00218
00219 void calcEdgeTransformTensors() const;
00220
00221
00222 void clearGeomNotAreas() const;
00223
00224
00225 void clearGeom() const;
00226
00227
00228 void clearAddressing() const;
00229
00230
00231 void clearOut() const;
00232
00233 public:
00234
00235
00236
00237 typedef faMesh Mesh;
00238 typedef faBoundaryMesh BoundaryMesh;
00239
00240
00241
00242
00243
00244 TypeName("faMesh");
00245
00246
00247 static word meshSubDir;
00248
00249
00250
00251
00252
00253
00254 faMesh
00255 (
00256 const polyMesh& m,
00257 IOobject::readOption r=IOobject::MUST_READ,
00258 IOobject::writeOption w=IOobject::AUTO_WRITE
00259 );
00260
00261
00262
00263 faMesh
00264 (
00265 const polyMesh& m,
00266 const labelList& faceLabels,
00267 IOobject::readOption r=IOobject::NO_READ,
00268 IOobject::writeOption w=IOobject::AUTO_WRITE
00269 );
00270
00271
00272
00273
00274 virtual ~faMesh();
00275
00276
00277
00278
00279
00280
00281
00282 fileName meshDir() const;
00283
00284
00285 const Time& time() const;
00286
00287
00288
00289
00290 inline label nPoints() const
00291 {
00292 return nPoints_;
00293 }
00294
00295 inline label nEdges() const
00296 {
00297 return nEdges_;
00298 }
00299
00300 inline label nInternalEdges() const
00301 {
00302 return nInternalEdges_;
00303 }
00304
00305 inline label nFaces() const
00306 {
00307 return nFaces_;
00308 }
00309
00310
00311
00312
00313 const pointField& points() const;
00314
00315
00316 const edgeList& edges() const;
00317
00318
00319 const faceList& faces() const;
00320
00321
00322 inline const labelList& edgeOwner() const
00323 {
00324 return edgeOwner_;
00325 }
00326
00327
00328 inline const labelList& edgeNeighbour() const
00329 {
00330 return edgeNeighbour_;
00331 }
00332
00333
00334
00335
00336 void addFaPatches(const List<faPatch*> &);
00337
00338
00339 const objectRegistry& db() const;
00340
00341
00342 const faBoundaryMesh& boundary() const;
00343
00344
00345 faBoundaryMesh& boundary();
00346
00347
00348 const labelList& faceLabels() const
00349 {
00350 return faceLabels_;
00351 }
00352
00353
00354
00355 const faProcTopology& parallelData() const;
00356
00357
00358
00359
00360
00361 bool moving() const
00362 {
00363 return moving_;
00364 }
00365
00366
00367 virtual tmp<scalarField> movePoints(const vectorField&);
00368
00369
00370
00371
00372
00373 const indirectPrimitivePatch& patch() const;
00374
00375
00376 indirectPrimitivePatch& patch();
00377
00378
00379 const lduAddressing& ldu() const;
00380
00381
00382 const labelList& patchStarts() const;
00383
00384
00385 const edgeVectorField& Le() const;
00386
00387
00388 const edgeScalarField& magLe() const;
00389
00390
00391 const areaVectorField& centres() const;
00392
00393
00394 const edgeVectorField& edgeCentres() const;
00395
00396
00397 const scalarField& S() const;
00398
00399
00400 const scalarField& S0() const;
00401
00402
00403 const scalarField& S00() const;
00404
00405
00406 const areaVectorField& faceAreaNormals() const;
00407
00408
00409 const edgeVectorField& edgeAreaNormals() const;
00410
00411
00412 const vectorField& pointAreaNormals() const;
00413
00414
00415 const areaScalarField& faceCurvatures() const;
00416
00417
00418 const FieldField<Field, tensor>& edgeTransformTensors() const;
00419
00420
00421 labelList internalPoints() const;
00422
00423
00424 labelList boundaryPoints() const;
00425
00426
00427 tmp<edgeScalarField> edgeLengthCorrection() const;
00428
00429
00430
00431
00432
00433 const unallocLabelList& owner() const
00434 {
00435 return ldu().lowerAddr();
00436 }
00437
00438
00439 const unallocLabelList& neighbour() const
00440 {
00441 return ldu().upperAddr();
00442 }
00443
00444
00445
00446
00447
00448 bool write
00449 (
00450 IOstream::streamFormat fmt,
00451 IOstream::versionNumber ver,
00452 IOstream::compressionType cmp
00453 ) const;
00454
00455
00456
00457
00458
00459 const polyMesh& operator()() const
00460 {
00461 return mesh_;
00462 }
00463
00464 bool operator!=(const faMesh& m) const;
00465
00466 bool operator==(const faMesh& m) const;
00467
00468
00469
00470
00471
00472
00473
00474
00475 friend Ostream& operator<<(Ostream&, const faMesh&);
00476 };
00477
00478
00479
00480
00481 }
00482
00483
00484
00485 #endif
00486
00487