boundaryMesh.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 #ifndef boundaryMesh_H
00038 #define boundaryMesh_H
00039
00040 #include "bMesh.H"
00041 #include "boundaryPatch.H"
00042 #include "PrimitivePatch.H"
00043 #include "PtrList.H"
00044 #include "polyPatchList.H"
00045 #include "className.H"
00046
00047
00048
00049 namespace Foam
00050 {
00051
00052
00053 class Time;
00054 class polyMesh;
00055 class primitiveMesh;
00056
00057
00058
00059
00060
00061 class boundaryMesh
00062 {
00063
00064
00065
00066
00067 static const vector splitNormal_;
00068
00069
00070
00071
00072 static const scalar distanceTol_;
00073
00074
00075
00076
00077 bMesh* meshPtr_;
00078
00079
00080 PtrList<boundaryPatch> patches_;
00081
00082
00083
00084 labelList meshFace_;
00085
00086
00087
00088
00089
00090
00091
00092 pointField featurePoints_;
00093
00094
00095 edgeList featureEdges_;
00096
00097
00098 labelList featureToEdge_;
00099
00100
00101 labelList edgeToFeature_;
00102
00103
00104
00105 labelListList featureSegments_;
00106
00107
00108 labelList extraEdges_;
00109
00110
00111
00112
00113
00114 label nFeatureEdges(label pointI) const;
00115
00116
00117 label nextFeatureEdge(const label edgeI, const label vertI) const;
00118
00119
00120 labelList collectSegment
00121 (
00122 const boolList& isFeaturePoint,
00123 const label startEdgeI,
00124 boolList& featVisited
00125 ) const;
00126
00127
00128
00129
00130 void markEdges
00131 (
00132 const label maxDistance,
00133 const label edgeI,
00134 const label distance,
00135 labelList& minDistance,
00136 DynamicList<label>& visited
00137 ) const;
00138
00139
00140 label findPatchID(const polyPatchList&, const word&) const;
00141
00142
00143 label whichPatch(const polyPatchList&, const label) const;
00144
00145
00146
00147
00148 labelList faceToEdge
00149 (
00150 const boolList& regionEdge,
00151 const label region,
00152 const labelList& changedFaces,
00153 labelList& edgeRegion
00154 ) const;
00155
00156
00157 labelList edgeToFace
00158 (
00159 const label region,
00160 const labelList& changedEdges,
00161 labelList& faceRegion
00162 ) const;
00163
00164
00165
00166 void markZone
00167 (
00168 const boolList& borderEdge,
00169 label faceI,
00170 label currentZone,
00171 labelList& faceZone
00172 ) const;
00173
00174
00175
00176 boundaryMesh(const boundaryMesh&);
00177
00178
00179 void operator=(const boundaryMesh&);
00180
00181
00182 public:
00183
00184
00185 ClassName("boundaryMesh");
00186
00187
00188
00189
00190
00191 boundaryMesh();
00192
00193
00194
00195
00196 ~boundaryMesh();
00197
00198 void clearOut();
00199
00200
00201
00202
00203
00204
00205 const bMesh& mesh() const
00206 {
00207 if (!meshPtr_)
00208 {
00209 FatalErrorIn("boundaryMesh::mesh()")
00210 << "No mesh available. Probably mesh not yet"
00211 << " read." << abort(FatalError);
00212 }
00213 return *meshPtr_;
00214 }
00215
00216 const PtrList<boundaryPatch>& patches() const
00217 {
00218 return patches_;
00219 }
00220
00221
00222
00223 const labelList& meshFace() const
00224 {
00225 return meshFace_;
00226 }
00227
00228
00229 const pointField& featurePoints() const
00230 {
00231 return featurePoints_;
00232 }
00233
00234
00235 const edgeList& featureEdges() const
00236 {
00237 return featureEdges_;
00238 }
00239
00240
00241 const labelList& featureToEdge() const
00242 {
00243 return featureToEdge_;
00244 }
00245
00246
00247 const labelList& edgeToFeature() const
00248 {
00249 return edgeToFeature_;
00250 }
00251
00252
00253 const labelListList& featureSegments() const
00254 {
00255 return featureSegments_;
00256 }
00257
00258
00259 const labelList& extraEdges() const
00260 {
00261 return extraEdges_;
00262 }
00263
00264
00265
00266
00267
00268 void read(const polyMesh&);
00269
00270
00271 void readTriSurface(const fileName&);
00272
00273
00274 void writeTriSurface(const fileName&) const;
00275
00276
00277
00278
00279 labelList getNearest
00280 (
00281 const primitiveMesh& pMesh,
00282 const vector& searchSpan
00283 ) const;
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 void patchify
00294 (
00295 const labelList& nearest,
00296 const polyBoundaryMesh& oldPatches,
00297 polyMesh& newMesh
00298 ) const;
00299
00300
00301
00302
00303 label whichPatch(const label faceI) const;
00304
00305
00306 label findPatchID(const word& patchName) const;
00307
00308
00309 wordList patchNames() const;
00310
00311
00312 void addPatch(const word& patchName);
00313
00314
00315 void deletePatch(const word& patchName);
00316
00317
00318 void changePatchType(const word& patchName, const word& type);
00319
00320
00321
00322 void changeFaces(const labelList& patchIDs, labelList& oldToNew);
00323
00324
00325
00326
00327
00328
00329 void setFeatureEdges(const scalar minCos);
00330
00331
00332
00333 void setExtraEdges(const label edgeI);
00334
00335
00336
00337
00338
00339
00340 label getNTris(const label faceI) const;
00341
00342
00343
00344 label getNTris
00345 (
00346 const label startFaceI,
00347 const label nFaces,
00348 labelList& nTris
00349 ) const;
00350
00351
00352
00353
00354 void triangulate
00355 (
00356 const label startFaceI,
00357 const label nFaces,
00358 const label totalNTris,
00359 labelList& triVerts
00360 ) const;
00361
00362
00363 label getNPoints(const label startFaceI, const label nFaces) const;
00364
00365
00366
00367 void triangulateLocal
00368 (
00369 const label startFaceI,
00370 const label nFaces,
00371 const label totalNTris,
00372 labelList& triVerts,
00373 labelList& localToGlobal
00374 ) const;
00375
00376
00377
00378
00379 void markFaces
00380 (
00381 const labelList& protectedEdges,
00382 const label faceI,
00383 boolList& visited
00384 ) const;
00385 };
00386
00387
00388
00389
00390 }
00391
00392
00393
00394 #endif
00395
00396
Copyright © 2000-2009 OpenCFD Ltd