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