PrimitivePatch.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
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef PrimitivePatch_H
00053 #define PrimitivePatch_H
00054
00055 #include "boolList.H"
00056 #include "labelList.H"
00057 #include "edgeList.H"
00058 #include "point.H"
00059 #include "intersection.H"
00060 #include "HashSet.H"
00061
00062
00063
00064 namespace Foam
00065 {
00066
00067 class face;
00068 class objectHit;
00069 template<class T> class Map;
00070
00071
00072
00073
00074
00075 TemplateName(PrimitivePatch);
00076
00077
00078
00079
00080
00081
00082 template
00083 <
00084 class Face,
00085 template<class> class FaceList,
00086 class PointField,
00087 class PointType=point
00088 >
00089 class PrimitivePatch
00090 :
00091 public PrimitivePatchName,
00092 public FaceList<Face>
00093 {
00094
00095 public:
00096
00097
00098
00099 typedef Face FaceType;
00100 typedef FaceList<Face> FaceListType;
00101 typedef PointField PointFieldType;
00102
00103
00104
00105
00106
00107 enum surfaceTopo
00108 {
00109 MANIFOLD,
00110 OPEN,
00111 ILLEGAL
00112 };
00113
00114 private:
00115
00116
00117
00118
00119 PointField points_;
00120
00121
00122
00123
00124
00125
00126
00127 mutable edgeList* edgesPtr_;
00128
00129
00130 mutable label nInternalEdges_;
00131
00132
00133 mutable labelList* boundaryPointsPtr_;
00134
00135
00136 mutable labelListList* faceFacesPtr_;
00137
00138
00139 mutable labelListList* edgeFacesPtr_;
00140
00141
00142 mutable labelListList* faceEdgesPtr_;
00143
00144
00145 mutable labelListList* pointEdgesPtr_;
00146
00147
00148 mutable labelListList* pointFacesPtr_;
00149
00150
00151 mutable List<Face>* localFacesPtr_;
00152
00153
00154 mutable labelList* meshPointsPtr_;
00155
00156
00157
00158 mutable Map<label>* meshPointMapPtr_;
00159
00160
00161 mutable labelListList* edgeLoopsPtr_;
00162
00163
00164 mutable Field<PointType>* localPointsPtr_;
00165
00166
00167 mutable labelList* localPointOrderPtr_;
00168
00169
00170 mutable Field<PointType>* faceNormalsPtr_;
00171
00172
00173 mutable Field<PointType>* pointNormalsPtr_;
00174
00175
00176
00177
00178
00179 void calcIntBdryEdges() const;
00180
00181
00182 void calcBdryPoints() const;
00183
00184
00185 void calcAddressing() const;
00186
00187
00188 void calcPointEdges() const;
00189
00190
00191 void calcPointFaces() const;
00192
00193
00194 void calcMeshData() const;
00195
00196
00197 void calcMeshPointMap() const;
00198
00199
00200 void calcEdgeLoops() const;
00201
00202
00203 void calcLocalPoints() const;
00204
00205
00206 void calcLocalPointOrder() const;
00207
00208
00209 void calcFaceNormals() const;
00210
00211
00212 void calcPointNormals() const;
00213
00214
00215 void calcEdgeOwner() const;
00216
00217
00218
00219
00220 void visitPointRegion
00221 (
00222 const label pointI,
00223 const labelList& pFaces,
00224 const label startFaceI,
00225 const label startEdgeI,
00226 boolList& pFacesHad
00227 ) const;
00228
00229
00230 public:
00231
00232
00233
00234
00235 PrimitivePatch
00236 (
00237 const FaceList<Face>& faces,
00238 const Field<PointType>& points
00239 );
00240
00241
00242 PrimitivePatch
00243 (
00244 FaceList<Face>& faces,
00245 Field<PointType>& points,
00246 const bool reUse
00247 );
00248
00249
00250 PrimitivePatch
00251 (
00252 const PrimitivePatch<Face, FaceList, PointField, PointType>&
00253 );
00254
00255
00256
00257
00258 virtual ~PrimitivePatch();
00259
00260 void clearOut();
00261
00262 void clearGeom();
00263
00264 void clearTopology();
00265
00266 void clearPatchMeshAddr();
00267
00268
00269
00270
00271
00272
00273
00274 const Field<PointType>& points() const
00275 {
00276 return points_;
00277 }
00278
00279
00280
00281
00282
00283
00284
00285 label nPoints() const
00286 {
00287 return meshPoints().size();
00288 }
00289
00290
00291 label nEdges() const
00292 {
00293 return edges().size();
00294 }
00295
00296
00297 const edgeList& edges() const;
00298
00299
00300 label nInternalEdges() const;
00301
00302
00303 bool isInternalEdge(const label edgeI) const
00304 {
00305 return edgeI < nInternalEdges();
00306 }
00307
00308
00309
00310 const labelList& boundaryPoints() const;
00311
00312
00313 const labelListList& faceFaces() const;
00314
00315
00316 const labelListList& edgeFaces() const;
00317
00318
00319 const labelListList& faceEdges() const;
00320
00321
00322 const labelListList& pointEdges() const;
00323
00324
00325 const labelListList& pointFaces() const;
00326
00327
00328 const List<Face>& localFaces() const;
00329
00330
00331
00332
00333
00334
00335
00336 const labelList& meshPoints() const;
00337
00338
00339
00340 const Map<label>& meshPointMap() const;
00341
00342
00343 const Field<PointType>& localPoints() const;
00344
00345
00346 const labelList& localPointOrder() const;
00347
00348
00349
00350 label whichPoint(const label gp) const;
00351
00352
00353
00354 label whichEdge(const edge&) const;
00355
00356
00357
00358 labelList meshEdges
00359 (
00360 const edgeList& allEdges,
00361 const labelListList& cellEdges,
00362 const labelList& faceCells
00363 ) const;
00364
00365
00366
00367 labelList meshEdges
00368 (
00369 const edgeList& allEdges,
00370 const labelListList& pointEdges
00371 ) const;
00372
00373
00374 const Field<PointType>& faceNormals() const;
00375
00376
00377 const Field<PointType>& pointNormals() const;
00378
00379
00380
00381
00382
00383 template <class ToPatch>
00384 List<objectHit> projectPoints
00385 (
00386 const ToPatch& targetPatch,
00387 const Field<PointType>& projectionDirection,
00388 const intersection::algorithm = intersection::FULL_RAY,
00389 const intersection::direction = intersection::VECTOR
00390 ) const;
00391
00392
00393 template <class ToPatch>
00394 List<objectHit> projectFaceCentres
00395 (
00396 const ToPatch& targetPatch,
00397 const Field<PointType>& projectionDirection,
00398 const intersection::algorithm = intersection::FULL_RAY,
00399 const intersection::direction = intersection::VECTOR
00400 ) const;
00401
00402
00403
00404
00405 const labelListList& edgeLoops() const;
00406
00407
00408
00409
00410
00411
00412
00413
00414 surfaceTopo surfaceType() const;
00415
00416
00417
00418
00419 bool checkTopology
00420 (
00421 const bool report = false,
00422 labelHashSet* setPtr = NULL
00423 ) const;
00424
00425
00426
00427
00428
00429
00430
00431 bool checkPointManifold
00432 (
00433 const bool report = false,
00434 labelHashSet* setPtr = NULL
00435 ) const;
00436
00437
00438
00439
00440
00441 virtual void movePoints(const Field<PointType>&);
00442
00443
00444
00445
00446
00447 void operator=
00448 (
00449 const PrimitivePatch<Face, FaceList, PointField, PointType>&
00450 );
00451 };
00452
00453
00454
00455
00456 }
00457
00458
00459
00460 #ifdef NoRepository
00461 # include "PrimitivePatch.C"
00462 #endif
00463
00464
00465
00466 #endif
00467
00468
Copyright © 2000-2009 OpenCFD Ltd