OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

polyDualMesh.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 InClass
00026     polyDualMesh
00027 
00028 \*---------------------------------------------------------------------------*/
00029 
00030 #include "polyDualMesh.H"
00031 #include "meshTools.H"
00032 #include "OFstream.H"
00033 #include "Time.H"
00034 #include "SortableList.H"
00035 #include "pointSet.H"
00036 
00037 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00038 
00039 namespace Foam
00040 {
00041     defineTypeNameAndDebug(polyDualMesh, 0);
00042 }
00043 
00044 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00045 
00046 // Determine order for faces:
00047 // - upper-triangular order for internal faces
00048 // - external faces after internal faces (were already so)
00049 Foam::labelList Foam::polyDualMesh::getFaceOrder
00050 (
00051     const labelList& faceOwner,
00052     const labelList& faceNeighbour,
00053     const cellList& cells,
00054     label& nInternalFaces
00055 )
00056 {
00057     labelList oldToNew(faceOwner.size(), -1);
00058 
00059     // First unassigned face
00060     label newFaceI = 0;
00061 
00062     forAll(cells, cellI)
00063     {
00064         const labelList& cFaces = cells[cellI];
00065 
00066         SortableList<label> nbr(cFaces.size());
00067 
00068         forAll(cFaces, i)
00069         {
00070             label faceI = cFaces[i];
00071 
00072             label nbrCellI = faceNeighbour[faceI];
00073 
00074             if (nbrCellI != -1)
00075             {
00076                 // Internal face. Get cell on other side.
00077                 if (nbrCellI == cellI)
00078                 {
00079                     nbrCellI = faceOwner[faceI];
00080                 }
00081 
00082                 if (cellI < nbrCellI)
00083                 {
00084                     // CellI is master
00085                     nbr[i] = nbrCellI;
00086                 }
00087                 else
00088                 {
00089                     // nbrCell is master. Let it handle this face.
00090                     nbr[i] = -1;
00091                 }
00092             }
00093             else
00094             {
00095                 // External face. Do later.
00096                 nbr[i] = -1;
00097             }
00098         }
00099 
00100         nbr.sort();
00101 
00102         forAll(nbr, i)
00103         {
00104             if (nbr[i] != -1)
00105             {
00106                 oldToNew[cFaces[nbr.indices()[i]]] = newFaceI++;
00107             }
00108         }
00109     }
00110 
00111     nInternalFaces = newFaceI;
00112 
00113     Pout<< "nInternalFaces:" << nInternalFaces << endl;
00114     Pout<< "nFaces:" << faceOwner.size() << endl;
00115     Pout<< "nCells:" << cells.size() << endl;
00116 
00117     // Leave patch faces intact.
00118     for (label faceI = newFaceI; faceI < faceOwner.size(); faceI++)
00119     {
00120         oldToNew[faceI] = faceI;
00121     }
00122 
00123 
00124     // Check done all faces.
00125     forAll(oldToNew, faceI)
00126     {
00127         if (oldToNew[faceI] == -1)
00128         {
00129             FatalErrorIn
00130             (
00131                 "polyDualMesh::getFaceOrder"
00132                 "(const labelList&, const labelList&, const label) const"
00133             )   << "Did not determine new position"
00134                 << " for face " << faceI
00135                 << abort(FatalError);
00136         }
00137     }
00138 
00139     return oldToNew;
00140 }
00141 
00142 
00143 // Get the two edges on faceI using pointI. Returns them such that the order
00144 // - otherVertex of e0
00145 // - pointI
00146 // - otherVertex(pointI) of e1
00147 // is in face order
00148 void Foam::polyDualMesh::getPointEdges
00149 (
00150     const primitivePatch& patch,
00151     const label faceI,
00152     const label pointI,
00153     label& e0,
00154     label& e1
00155 )
00156 {
00157     const labelList& fEdges = patch.faceEdges()[faceI];
00158     const face& f = patch.localFaces()[faceI];
00159 
00160     e0 = -1;
00161     e1 = -1;
00162 
00163     forAll(fEdges, i)
00164     {
00165         label edgeI = fEdges[i];
00166 
00167         const edge& e = patch.edges()[edgeI];
00168 
00169         if (e[0] == pointI)
00170         {
00171             // One of the edges using pointI. Check which one.
00172             label index = findIndex(f, pointI);
00173 
00174             if (f.nextLabel(index) == e[1])
00175             {
00176                 e1 = edgeI;
00177             }
00178             else
00179             {
00180                 e0 = edgeI;
00181             }
00182 
00183             if (e0 != -1 && e1 != -1)
00184             {
00185                 return;
00186             }
00187         }
00188         else if (e[1] == pointI)
00189         {
00190             // One of the edges using pointI. Check which one.
00191             label index = findIndex(f, pointI);
00192 
00193             if (f.nextLabel(index) == e[0])
00194             {
00195                 e1 = edgeI;
00196             }
00197             else
00198             {
00199                 e0 = edgeI;
00200             }
00201 
00202             if (e0 != -1 && e1 != -1)
00203             {
00204                 return;
00205             }
00206         }
00207     }
00208 
00209     FatalErrorIn("getPointEdges") << "Cannot find two edges on face:" << faceI
00210         << " vertices:" << patch.localFaces()[faceI]
00211         << " that uses point:" << pointI
00212         << abort(FatalError);
00213 }
00214 
00215 
00216 // Collect the face on an external point of the patch.
00217 Foam::labelList Foam::polyDualMesh::collectPatchSideFace
00218 (
00219     const polyPatch& patch,
00220     const label patchToDualOffset,
00221     const labelList& edgeToDualPoint,
00222     const labelList& pointToDualPoint,
00223     const label pointI,
00224 
00225     label& edgeI
00226 )
00227 {
00228     // Construct face by walking around e[eI] starting from
00229     // patchEdgeI
00230 
00231     label meshPointI = patch.meshPoints()[pointI];
00232     const labelList& pFaces = patch.pointFaces()[pointI];
00233 
00234     DynamicList<label> dualFace;
00235 
00236     if (pointToDualPoint[meshPointI] >= 0)
00237     {
00238         // Number of pFaces + 2 boundary edge + feature point
00239         dualFace.setCapacity(pFaces.size()+2+1);
00240         // Store dualVertex for feature edge
00241         dualFace.append(pointToDualPoint[meshPointI]);
00242     }
00243     else
00244     {
00245         dualFace.setCapacity(pFaces.size()+2);
00246     }
00247 
00248     // Store dual vertex for starting edge.
00249     if (edgeToDualPoint[patch.meshEdges()[edgeI]] < 0)
00250     {
00251         FatalErrorIn("polyDualMesh::collectPatchSideFace") << edgeI
00252             << abort(FatalError);
00253     }
00254 
00255     dualFace.append(edgeToDualPoint[patch.meshEdges()[edgeI]]);
00256 
00257     label faceI = patch.edgeFaces()[edgeI][0];
00258 
00259     // Check order of vertices of edgeI in face to see if we need to reverse.
00260     bool reverseFace;
00261 
00262     label e0, e1;
00263     getPointEdges(patch, faceI, pointI, e0, e1);
00264 
00265     if (e0 == edgeI)
00266     {
00267         reverseFace = true;
00268     }
00269     else
00270     {
00271         reverseFace = false;
00272     }
00273 
00274     while (true)
00275     {
00276         // Store dual vertex for faceI.
00277         dualFace.append(faceI + patchToDualOffset);
00278 
00279         // Cross face to other edge on pointI
00280         label e0, e1;
00281         getPointEdges(patch, faceI, pointI, e0, e1);
00282 
00283         if (e0 == edgeI)
00284         {
00285             edgeI = e1;
00286         }
00287         else
00288         {
00289             edgeI = e0;
00290         }
00291 
00292         if (edgeToDualPoint[patch.meshEdges()[edgeI]] >= 0)
00293         {
00294             // Feature edge. Insert dual vertex for edge.
00295             dualFace.append(edgeToDualPoint[patch.meshEdges()[edgeI]]);
00296         }
00297 
00298         const labelList& eFaces = patch.edgeFaces()[edgeI];
00299 
00300         if (eFaces.size() == 1)
00301         {
00302             // Reached other edge of patch
00303             break;
00304         }
00305 
00306         // Cross edge to other face.
00307         if (eFaces[0] == faceI)
00308         {
00309             faceI = eFaces[1];
00310         }
00311         else
00312         {
00313             faceI = eFaces[0];
00314         }
00315     }
00316 
00317     dualFace.shrink();
00318 
00319     if (reverseFace)
00320     {
00321         reverse(dualFace);
00322     }
00323 
00324     return dualFace;
00325 }
00326 
00327 
00328 // Collect face around pointI which is not on the outside of the patch.
00329 // Returns the vertices of the face and the indices in these vertices of
00330 // any points which are on feature edges.
00331 void Foam::polyDualMesh::collectPatchInternalFace
00332 (
00333     const polyPatch& patch,
00334     const label patchToDualOffset,
00335     const labelList& edgeToDualPoint,
00336 
00337     const label pointI,
00338     const label startEdgeI,
00339 
00340     labelList& dualFace2,
00341     labelList& featEdgeIndices2
00342 )
00343 {
00344     // Construct face by walking around pointI starting from startEdgeI
00345     const labelList& meshEdges = patch.meshEdges();
00346     const labelList& pFaces = patch.pointFaces()[pointI];
00347 
00348     // Vertices of dualFace
00349     DynamicList<label> dualFace(pFaces.size());
00350     // Indices in dualFace of vertices added because of feature edge
00351     DynamicList<label> featEdgeIndices(dualFace.size());
00352 
00353 
00354     label edgeI = startEdgeI;
00355     label faceI = patch.edgeFaces()[edgeI][0];
00356 
00357     // Check order of vertices of edgeI in face to see if we need to reverse.
00358     bool reverseFace;
00359 
00360     label e0, e1;
00361     getPointEdges(patch, faceI, pointI, e0, e1);
00362 
00363     if (e0 == edgeI)
00364     {
00365         reverseFace = true;
00366     }
00367     else
00368     {
00369         reverseFace = false;
00370     }
00371 
00372     while (true)
00373     {
00374         // Insert dual vertex for face
00375         dualFace.append(faceI + patchToDualOffset);
00376 
00377         // Cross face to other edge on pointI
00378         label e0, e1;
00379         getPointEdges(patch, faceI, pointI, e0, e1);
00380 
00381         if (e0 == edgeI)
00382         {
00383             edgeI = e1;
00384         }
00385         else
00386         {
00387             edgeI = e0;
00388         }
00389 
00390         if (edgeToDualPoint[meshEdges[edgeI]] >= 0)
00391         {
00392             // Feature edge. Insert dual vertex for edge.
00393             dualFace.append(edgeToDualPoint[meshEdges[edgeI]]);
00394             featEdgeIndices.append(dualFace.size()-1);
00395         }
00396 
00397         if (edgeI == startEdgeI)
00398         {
00399             break;
00400         }
00401 
00402         // Cross edge to other face.
00403         const labelList& eFaces = patch.edgeFaces()[edgeI];
00404 
00405         if (eFaces[0] == faceI)
00406         {
00407             faceI = eFaces[1];
00408         }
00409         else
00410         {
00411             faceI = eFaces[0];
00412         }
00413     }
00414 
00415     dualFace2.transfer(dualFace);
00416 
00417     featEdgeIndices2.transfer(featEdgeIndices);
00418 
00419     if (reverseFace)
00420     {
00421         reverse(dualFace2);
00422 
00423         // Correct featEdgeIndices for change in dualFace2
00424         forAll(featEdgeIndices2, i)
00425         {
00426             featEdgeIndices2[i] = dualFace2.size() -1 - featEdgeIndices2[i];
00427         }
00428         // Reverse indices (might not be nessecary but do anyway)
00429         reverse(featEdgeIndices2);
00430     }
00431 }
00432 
00433 
00434 void Foam::polyDualMesh::splitFace
00435 (
00436     const polyPatch& patch,
00437     const labelList& pointToDualPoint,
00438 
00439     const label pointI,
00440     const labelList& dualFace,
00441     const labelList& featEdgeIndices,
00442 
00443     DynamicList<face>& dualFaces,
00444     DynamicList<label>& dualOwner,
00445     DynamicList<label>& dualNeighbour,
00446     DynamicList<label>& dualRegion
00447 )
00448 {
00449 
00450     // Split face because of feature edges/points
00451     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00452     label meshPointI = patch.meshPoints()[pointI];
00453 
00454     if (pointToDualPoint[meshPointI] >= 0)
00455     {
00456         // Feature point. Do face-centre decomposition.
00457 
00458         if (featEdgeIndices.size() < 2)
00459         {
00460             // Feature point but no feature edges. Not handled at the moment
00461             dualFaces.append(face(dualFace));
00462             dualOwner.append(meshPointI);
00463             dualNeighbour.append(-1);
00464             dualRegion.append(patch.index());
00465         }
00466         else
00467         {
00468             // Do 'face-centre' decomposition. Start from first feature
00469             // edge create face up until next feature edge.
00470 
00471             forAll(featEdgeIndices, i)
00472             {
00473                 label startFp = featEdgeIndices[i];
00474 
00475                 label endFp = featEdgeIndices[(i+1) % featEdgeIndices.size()];
00476 
00477                 // Collect face from startFp to endFp
00478                 label sz = 0;
00479 
00480                 if (endFp > startFp)
00481                 {
00482                     sz = endFp - startFp + 2;
00483                 }
00484                 else
00485                 {
00486                     sz = endFp + dualFace.size() - startFp + 2;
00487                 }
00488                 face subFace(sz);
00489 
00490                 // feature point becomes face centre.
00491                 subFace[0] = pointToDualPoint[patch.meshPoints()[pointI]];
00492 
00493                 // Copy from startFp up to endFp.
00494                 for (label subFp = 1; subFp < subFace.size(); subFp++)
00495                 {
00496                     subFace[subFp] = dualFace[startFp];
00497 
00498                     startFp = (startFp+1) % dualFace.size();
00499                 }
00500 
00501                 dualFaces.append(face(subFace));
00502                 dualOwner.append(meshPointI);
00503                 dualNeighbour.append(-1);
00504                 dualRegion.append(patch.index());
00505             }
00506         }
00507     }
00508     else
00509     {
00510         // No feature point. Check if feature edges.
00511         if (featEdgeIndices.size() < 2)
00512         {
00513             // Not enough feature edges. No split.
00514             dualFaces.append(face(dualFace));
00515             dualOwner.append(meshPointI);
00516             dualNeighbour.append(-1);
00517             dualRegion.append(patch.index());
00518         }
00519         else
00520         {
00521             // Multiple feature edges but no feature point.
00522             // Split face along feature edges. Gives weird result if
00523             // number of feature edges > 2.
00524 
00525             // Storage for new face
00526             DynamicList<label> subFace(dualFace.size());
00527 
00528             forAll(featEdgeIndices, featI)
00529             {
00530                 label startFp = featEdgeIndices[featI];
00531                 label endFp = featEdgeIndices[featEdgeIndices.fcIndex(featI)];
00532 
00533                 label fp = startFp;
00534 
00535                 while (true)
00536                 {
00537                     label vertI = dualFace[fp];
00538 
00539                     subFace.append(vertI);
00540 
00541                     if (fp == endFp)
00542                     {
00543                         break;
00544                     }
00545 
00546                     fp = dualFace.fcIndex(fp);
00547                 }
00548 
00549                 if (subFace.size() > 2)
00550                 {
00551                     // Enough vertices to create a face from.
00552                     subFace.shrink();
00553 
00554                     dualFaces.append(face(subFace));
00555                     dualOwner.append(meshPointI);
00556                     dualNeighbour.append(-1);
00557                     dualRegion.append(patch.index());
00558 
00559                     subFace.clear();
00560                 }
00561             }
00562             // Check final face.
00563             if (subFace.size() > 2)
00564             {
00565                 // Enough vertices to create a face from.
00566                 subFace.shrink();
00567 
00568                 dualFaces.append(face(subFace));
00569                 dualOwner.append(meshPointI);
00570                 dualNeighbour.append(-1);
00571                 dualRegion.append(patch.index());
00572 
00573                 subFace.clear();
00574             }
00575         }
00576     }
00577 }
00578 
00579 
00580 // Create boundary face for every point in patch
00581 void Foam::polyDualMesh::dualPatch
00582 (
00583     const polyPatch& patch,
00584     const label patchToDualOffset,
00585     const labelList& edgeToDualPoint,
00586     const labelList& pointToDualPoint,
00587 
00588     const pointField& dualPoints,
00589 
00590     DynamicList<face>& dualFaces,
00591     DynamicList<label>& dualOwner,
00592     DynamicList<label>& dualNeighbour,
00593     DynamicList<label>& dualRegion
00594 )
00595 {
00596     const labelList& meshEdges = patch.meshEdges();
00597 
00598     // Whether edge has been done.
00599     // 0 : not
00600     // 1 : done e.start()
00601     // 2 : done e.end()
00602     // 3 : done both
00603     labelList doneEdgeSide(meshEdges.size(), 0);
00604 
00605     boolList donePoint(patch.nPoints(), false);
00606 
00607 
00608     // Do points on edge of patch
00609     // ~~~~~~~~~~~~~~~~~~~~~~~~~~
00610 
00611     forAll(doneEdgeSide, patchEdgeI)
00612     {
00613         const labelList& eFaces = patch.edgeFaces()[patchEdgeI];
00614 
00615         if (eFaces.size() == 1)
00616         {
00617             const edge& e = patch.edges()[patchEdgeI];
00618 
00619             forAll(e, eI)
00620             {
00621                 label bitMask = 1<<eI;
00622 
00623                 if ((doneEdgeSide[patchEdgeI] & bitMask) == 0)
00624                 {
00625                     // Construct face by walking around e[eI] starting from
00626                     // patchEdgeI
00627 
00628                     label pointI = e[eI];
00629 
00630                     label edgeI = patchEdgeI;
00631                     labelList dualFace
00632                     (
00633                         collectPatchSideFace
00634                         (
00635                             patch,
00636                             patchToDualOffset,
00637                             edgeToDualPoint,
00638                             pointToDualPoint,
00639 
00640                             pointI,
00641                             edgeI
00642                         )
00643                     );
00644 
00645                     // Now edgeI is end edge. Mark as visited
00646                     if (patch.edges()[edgeI][0] == pointI)
00647                     {
00648                         doneEdgeSide[edgeI] |= 1;
00649                     }
00650                     else
00651                     {
00652                         doneEdgeSide[edgeI] |= 2;
00653                     }
00654 
00655                     dualFaces.append(face(dualFace));
00656                     dualOwner.append(patch.meshPoints()[pointI]);
00657                     dualNeighbour.append(-1);
00658                     dualRegion.append(patch.index());
00659 
00660                     doneEdgeSide[patchEdgeI] |= bitMask;
00661                     donePoint[pointI] = true;
00662                 }
00663             }
00664         }
00665     }
00666 
00667 
00668 
00669     // Do patch-internal points
00670     // ~~~~~~~~~~~~~~~~~~~~~~~~
00671 
00672     forAll(donePoint, pointI)
00673     {
00674         if (!donePoint[pointI])
00675         {
00676             labelList dualFace, featEdgeIndices;
00677 
00678             collectPatchInternalFace
00679             (
00680                 patch,
00681                 patchToDualOffset,
00682                 edgeToDualPoint,
00683                 pointI,
00684                 patch.pointEdges()[pointI][0],  // Arbitrary starting edge
00685 
00686                 dualFace,
00687                 featEdgeIndices
00688             );
00689 
00690             //- Either keep in one piece or split face according to feature.
00691 
00693             //dualFaces.append(face(dualFace));
00694             //dualOwner.append(patch.meshPoints()[pointI]);
00695             //dualNeighbour.append(-1);
00696             //dualRegion.append(patch.index());
00697 
00698             splitFace
00699             (
00700                 patch,
00701                 pointToDualPoint,
00702                 pointI,
00703                 dualFace,
00704                 featEdgeIndices,
00705 
00706                 dualFaces,
00707                 dualOwner,
00708                 dualNeighbour,
00709                 dualRegion
00710             );
00711 
00712             donePoint[pointI] = true;
00713         }
00714     }
00715 }
00716 
00717 
00718 void Foam::polyDualMesh::calcDual
00719 (
00720     const polyMesh& mesh,
00721     const labelList& featureEdges,
00722     const labelList& featurePoints
00723 )
00724 {
00725     const polyBoundaryMesh& patches = mesh.boundaryMesh();
00726     const label nIntFaces = mesh.nInternalFaces();
00727 
00728 
00729     // Get patch for all of outside
00730     primitivePatch allBoundary
00731     (
00732         SubList<face>
00733         (
00734             mesh.faces(),
00735             mesh.nFaces() - nIntFaces,
00736             nIntFaces
00737         ),
00738         mesh.points()
00739     );
00740 
00741     // Correspondence from patch edge to mesh edge.
00742     labelList meshEdges
00743     (
00744         allBoundary.meshEdges
00745         (
00746             mesh.edges(),
00747             mesh.pointEdges()
00748         )
00749     );
00750 
00751     {
00752         pointSet nonManifoldPoints
00753         (
00754             mesh,
00755             "nonManifoldPoints",
00756             meshEdges.size() / 100
00757         );
00758 
00759         allBoundary.checkPointManifold(true, &nonManifoldPoints);
00760 
00761         if (nonManifoldPoints.size())
00762         {
00763             nonManifoldPoints.write();
00764 
00765             FatalErrorIn
00766             (
00767                 "polyDualMesh::calcDual(const polyMesh&, const labelList&"
00768                 ", const labelList&)"
00769             )   << "There are " << nonManifoldPoints.size() << " points where"
00770                 << " the outside of the mesh is non-manifold." << nl
00771                 << "Such a mesh cannot be converted to a dual." << nl
00772                 << "Writing points at non-manifold sites to pointSet "
00773                 << nonManifoldPoints.name()
00774                 << exit(FatalError);
00775         }
00776     }
00777 
00778 
00779     // Assign points
00780     // ~~~~~~~~~~~~~
00781 
00782     // mesh label   dualMesh vertex
00783     // ----------   ---------------
00784     // cellI        cellI
00785     // faceI        nCells+faceI-nIntFaces
00786     // featEdgeI    nCells+nFaces-nIntFaces+featEdgeI
00787     // featPointI   nCells+nFaces-nIntFaces+nFeatEdges+featPointI
00788 
00789     pointField dualPoints
00790     (
00791         mesh.nCells()                           // cell centres
00792       + mesh.nFaces() - nIntFaces               // boundary face centres
00793       + featureEdges.size()                     // additional boundary edges
00794       + featurePoints.size()                    // additional boundary points
00795     );
00796 
00797     label dualPointI = 0;
00798 
00799 
00800     // Cell centres.
00801     const pointField& cellCentres = mesh.cellCentres();
00802 
00803     cellPoint_.setSize(cellCentres.size());
00804 
00805     forAll(cellCentres, cellI)
00806     {
00807         cellPoint_[cellI] = dualPointI;
00808         dualPoints[dualPointI++] = cellCentres[cellI];
00809     }
00810 
00811     // Boundary faces centres
00812     const pointField& faceCentres = mesh.faceCentres();
00813 
00814     boundaryFacePoint_.setSize(mesh.nFaces() - nIntFaces);
00815 
00816     for (label faceI = nIntFaces; faceI < mesh.nFaces(); faceI++)
00817     {
00818         boundaryFacePoint_[faceI - nIntFaces] = dualPointI;
00819         dualPoints[dualPointI++] = faceCentres[faceI];
00820     }
00821 
00822     // Edge status:
00823     //  >0 : dual point label (edge is feature edge)
00824     //  -1 : is boundary edge.
00825     //  -2 : is internal edge.
00826     labelList edgeToDualPoint(mesh.nEdges(), -2);
00827 
00828     forAll(meshEdges, patchEdgeI)
00829     {
00830         label edgeI = meshEdges[patchEdgeI];
00831 
00832         edgeToDualPoint[edgeI] = -1;
00833     }
00834 
00835     forAll(featureEdges, i)
00836     {
00837         label edgeI = featureEdges[i];
00838 
00839         const edge& e = mesh.edges()[edgeI];
00840 
00841         edgeToDualPoint[edgeI] = dualPointI;
00842         dualPoints[dualPointI++] = e.centre(mesh.points());
00843     }
00844 
00845 
00846 
00847     // Point status:
00848     //  >0 : dual point label (point is feature point)
00849     //  -1 : is point on edge of patch
00850     //  -2 : is point on patch (but not on edge)
00851     //  -3 : is internal point.
00852     labelList pointToDualPoint(mesh.nPoints(), -3);
00853 
00854     forAll(patches, patchI)
00855     {
00856         const labelList& meshPoints = patches[patchI].meshPoints();
00857 
00858         forAll(meshPoints, i)
00859         {
00860             pointToDualPoint[meshPoints[i]] = -2;
00861         }
00862 
00863         const labelListList& loops = patches[patchI].edgeLoops();
00864 
00865         forAll(loops, i)
00866         {
00867             const labelList& loop = loops[i];
00868 
00869             forAll(loop, j)
00870             {
00871                  pointToDualPoint[meshPoints[loop[j]]] = -1;
00872             }
00873         }
00874     }
00875 
00876     forAll(featurePoints, i)
00877     {
00878         label pointI = featurePoints[i];
00879 
00880         pointToDualPoint[pointI] = dualPointI;
00881         dualPoints[dualPointI++] = mesh.points()[pointI];
00882     }
00883 
00884 
00885     // Storage for new faces.
00886     // Dynamic sized since we don't know size.
00887 
00888     DynamicList<face> dynDualFaces(mesh.nEdges());
00889     DynamicList<label> dynDualOwner(mesh.nEdges());
00890     DynamicList<label> dynDualNeighbour(mesh.nEdges());
00891     DynamicList<label> dynDualRegion(mesh.nEdges());
00892 
00893 
00894     // Generate faces from edges on the boundary
00895     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00896 
00897     forAll(meshEdges, patchEdgeI)
00898     {
00899         label edgeI = meshEdges[patchEdgeI];
00900 
00901         const edge& e = mesh.edges()[edgeI];
00902 
00903         label owner = -1;
00904         label neighbour = -1;
00905 
00906         if (e[0] < e[1])
00907         {
00908             owner = e[0];
00909             neighbour = e[1];
00910         }
00911         else
00912         {
00913             owner = e[1];
00914             neighbour = e[0];
00915         }
00916 
00917         // Find the boundary faces using the edge.
00918         const labelList& patchFaces = allBoundary.edgeFaces()[patchEdgeI];
00919 
00920         if (patchFaces.size() != 2)
00921         {
00922             FatalErrorIn("polyDualMesh::calcDual")
00923                 << "Cannot handle edges with " << patchFaces.size()
00924                 << " connected boundary faces."
00925                 << abort(FatalError);
00926         }
00927 
00928         label face0 = patchFaces[0] + nIntFaces;
00929         const face& f0 = mesh.faces()[face0];
00930 
00931         label face1 = patchFaces[1] + nIntFaces;
00932 
00933         // We want to start walking from patchFaces[0] or patchFaces[1],
00934         // depending on which one uses owner,neighbour in the right order.
00935 
00936         label startFaceI = -1;
00937         label endFaceI = -1;
00938 
00939         label index = findIndex(f0, neighbour);
00940 
00941         if (f0.nextLabel(index) == owner)
00942         {
00943             startFaceI = face0;
00944             endFaceI = face1;
00945         }
00946         else
00947         {
00948             startFaceI = face1;
00949             endFaceI = face0;
00950         }
00951 
00952         // Now walk from startFaceI to cell to face to cell etc. until endFaceI
00953 
00954         DynamicList<label> dualFace;
00955 
00956         if (edgeToDualPoint[edgeI] >= 0)
00957         {
00958             // Number of cells + 2 boundary faces + feature edge point
00959             dualFace.setCapacity(mesh.edgeCells()[edgeI].size()+2+1);
00960             // Store dualVertex for feature edge
00961             dualFace.append(edgeToDualPoint[edgeI]);
00962         }
00963         else
00964         {
00965             dualFace.setCapacity(mesh.edgeCells()[edgeI].size()+2);
00966         }
00967 
00968         // Store dual vertex for starting face.
00969         dualFace.append(mesh.nCells() + startFaceI - nIntFaces);
00970 
00971         label cellI = mesh.faceOwner()[startFaceI];
00972         label faceI = startFaceI;
00973 
00974         while (true)
00975         {
00976             // Store dual vertex from cellI.
00977             dualFace.append(cellI);
00978 
00979             // Cross cell to other face on edge.
00980             label f0, f1;
00981             meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
00982 
00983             if (f0 == faceI)
00984             {
00985                 faceI = f1;
00986             }
00987             else
00988             {
00989                 faceI = f0;
00990             }
00991 
00992             // Cross face to other cell.
00993             if (faceI == endFaceI)
00994             {
00995                 break;
00996             }
00997 
00998             if (mesh.faceOwner()[faceI] == cellI)
00999             {
01000                 cellI = mesh.faceNeighbour()[faceI];
01001             }
01002             else
01003             {
01004                 cellI = mesh.faceOwner()[faceI];
01005             }
01006         }
01007 
01008         // Store dual vertex for endFace.
01009         dualFace.append(mesh.nCells() + endFaceI - nIntFaces);
01010 
01011         dynDualFaces.append(face(dualFace.shrink()));
01012         dynDualOwner.append(owner);
01013         dynDualNeighbour.append(neighbour);
01014         dynDualRegion.append(-1);
01015 
01016         {
01017             // Check orientation.
01018             const face& f = dynDualFaces[dynDualFaces.size()-1];
01019             vector n = f.normal(dualPoints);
01020             if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0)
01021             {
01022                 WarningIn("calcDual") << "Incorrect orientation"
01023                     << " on boundary edge:" << edgeI
01024                     << mesh.points()[mesh.edges()[edgeI][0]]
01025                     << mesh.points()[mesh.edges()[edgeI][1]]
01026                     << endl;
01027             }
01028         }
01029     }
01030 
01031 
01032     // Generate faces from internal edges
01033     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01034 
01035     forAll(edgeToDualPoint, edgeI)
01036     {
01037         if (edgeToDualPoint[edgeI] == -2)
01038         {
01039             // Internal edge.
01040 
01041             // Find dual owner, neighbour
01042 
01043             const edge& e = mesh.edges()[edgeI];
01044 
01045             label owner = -1;
01046             label neighbour = -1;
01047 
01048             if (e[0] < e[1])
01049             {
01050                 owner = e[0];
01051                 neighbour = e[1];
01052             }
01053             else
01054             {
01055                 owner = e[1];
01056                 neighbour = e[0];
01057             }
01058 
01059             // Get a starting cell
01060             const labelList& eCells = mesh.edgeCells()[edgeI];
01061 
01062             label cellI = eCells[0];
01063 
01064             // Get the two faces on the cell and edge.
01065             label face0, face1;
01066             meshTools::getEdgeFaces(mesh, cellI, edgeI, face0, face1);
01067 
01068             // Find the starting face by looking at the order in which
01069             // the face uses the owner, neighbour
01070             const face& f0 = mesh.faces()[face0];
01071 
01072             label index = findIndex(f0, neighbour);
01073 
01074             bool f0OrderOk = (f0.nextLabel(index) == owner);
01075 
01076             label startFaceI = -1;
01077 
01078             if (f0OrderOk == (mesh.faceOwner()[face0] == cellI))
01079             {
01080                 startFaceI = face0;
01081             }
01082             else
01083             {
01084                 startFaceI = face1;
01085             }
01086 
01087             // Walk face-cell-face until starting face reached.
01088             DynamicList<label> dualFace(mesh.edgeCells()[edgeI].size());
01089 
01090             label faceI = startFaceI;
01091 
01092             while (true)
01093             {
01094                 // Store dual vertex from cellI.
01095                 dualFace.append(cellI);
01096 
01097                 // Cross cell to other face on edge.
01098                 label f0, f1;
01099                 meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
01100 
01101                 if (f0 == faceI)
01102                 {
01103                     faceI = f1;
01104                 }
01105                 else
01106                 {
01107                     faceI = f0;
01108                 }
01109 
01110                 // Cross face to other cell.
01111                 if (faceI == startFaceI)
01112                 {
01113                     break;
01114                 }
01115 
01116                 if (mesh.faceOwner()[faceI] == cellI)
01117                 {
01118                     cellI = mesh.faceNeighbour()[faceI];
01119                 }
01120                 else
01121                 {
01122                     cellI = mesh.faceOwner()[faceI];
01123                 }
01124             }
01125 
01126             dynDualFaces.append(face(dualFace.shrink()));
01127             dynDualOwner.append(owner);
01128             dynDualNeighbour.append(neighbour);
01129             dynDualRegion.append(-1);
01130 
01131             {
01132                 // Check orientation.
01133                 const face& f = dynDualFaces[dynDualFaces.size()-1];
01134                 vector n = f.normal(dualPoints);
01135                 if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0)
01136                 {
01137                     WarningIn("calcDual") << "Incorrect orientation"
01138                         << " on internal edge:" << edgeI
01139                         << mesh.points()[mesh.edges()[edgeI][0]]
01140                         << mesh.points()[mesh.edges()[edgeI][1]]
01141                         << endl;
01142                 }
01143             }
01144         }
01145     }
01146 
01147     // Dump faces.
01148     if (debug)
01149     {
01150         dynDualFaces.shrink();
01151         dynDualOwner.shrink();
01152         dynDualNeighbour.shrink();
01153         dynDualRegion.shrink();
01154 
01155         OFstream str("dualInternalFaces.obj");
01156         Pout<< "polyDualMesh::calcDual : dumping internal faces to "
01157             << str.name() << endl;
01158 
01159         forAll(dualPoints, dualPointI)
01160         {
01161             meshTools::writeOBJ(str, dualPoints[dualPointI]);
01162         }
01163         forAll(dynDualFaces, dualFaceI)
01164         {
01165             const face& f = dynDualFaces[dualFaceI];
01166 
01167             str<< 'f';
01168             forAll(f, fp)
01169             {
01170                 str<< ' ' << f[fp]+1;
01171             }
01172             str<< nl;
01173         }
01174     }
01175 
01176     const label nInternalFaces = dynDualFaces.size();
01177 
01178     // Outside faces
01179     // ~~~~~~~~~~~~~
01180 
01181     forAll(patches, patchI)
01182     {
01183         const polyPatch& pp = patches[patchI];
01184 
01185         dualPatch
01186         (
01187             pp,
01188             mesh.nCells() + pp.start() - nIntFaces,
01189             edgeToDualPoint,
01190             pointToDualPoint,
01191 
01192             dualPoints,
01193 
01194             dynDualFaces,
01195             dynDualOwner,
01196             dynDualNeighbour,
01197             dynDualRegion
01198         );
01199     }
01200 
01201 
01202     // Transfer face info to straight lists
01203     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01204     faceList dualFaces(dynDualFaces.shrink(), true);
01205     dynDualFaces.clear();
01206 
01207     labelList dualOwner(dynDualOwner.shrink(), true);
01208     dynDualOwner.clear();
01209 
01210     labelList dualNeighbour(dynDualNeighbour.shrink(), true);
01211     dynDualNeighbour.clear();
01212 
01213     labelList dualRegion(dynDualRegion.shrink(), true);
01214     dynDualRegion.clear();
01215 
01216 
01217 
01218     // Dump faces.
01219     if (debug)
01220     {
01221         OFstream str("dualFaces.obj");
01222         Pout<< "polyDualMesh::calcDual : dumping all faces to "
01223             << str.name() << endl;
01224 
01225         forAll(dualPoints, dualPointI)
01226         {
01227             meshTools::writeOBJ(str, dualPoints[dualPointI]);
01228         }
01229         forAll(dualFaces, dualFaceI)
01230         {
01231             const face& f = dualFaces[dualFaceI];
01232 
01233             str<< 'f';
01234             forAll(f, fp)
01235             {
01236                 str<< ' ' << f[fp]+1;
01237             }
01238             str<< nl;
01239         }
01240     }
01241 
01242     // Create cells.
01243     cellList dualCells(mesh.nPoints());
01244 
01245     forAll(dualCells, cellI)
01246     {
01247         dualCells[cellI].setSize(0);
01248     }
01249 
01250     forAll(dualOwner, faceI)
01251     {
01252         label cellI = dualOwner[faceI];
01253 
01254         labelList& cFaces = dualCells[cellI];
01255 
01256         label sz = cFaces.size();
01257         cFaces.setSize(sz+1);
01258         cFaces[sz] = faceI;
01259     }
01260     forAll(dualNeighbour, faceI)
01261     {
01262         label cellI = dualNeighbour[faceI];
01263 
01264         if (cellI != -1)
01265         {
01266             labelList& cFaces = dualCells[cellI];
01267 
01268             label sz = cFaces.size();
01269             cFaces.setSize(sz+1);
01270             cFaces[sz] = faceI;
01271         }
01272     }
01273 
01274 
01275     // Do upper-triangular face ordering. Determines face reordering map and
01276     // number of internal faces.
01277     label dummy;
01278 
01279     labelList oldToNew
01280     (
01281         getFaceOrder
01282         (
01283             dualOwner,
01284             dualNeighbour,
01285             dualCells,
01286             dummy
01287         )
01288     );
01289 
01290     // Reorder faces.
01291     inplaceReorder(oldToNew, dualFaces);
01292     inplaceReorder(oldToNew, dualOwner);
01293     inplaceReorder(oldToNew, dualNeighbour);
01294     inplaceReorder(oldToNew, dualRegion);
01295     forAll(dualCells, cellI)
01296     {
01297         inplaceRenumber(oldToNew, dualCells[cellI]);
01298     }
01299 
01300 
01301     // Create patches
01302     labelList patchSizes(patches.size(), 0);
01303 
01304     forAll(dualRegion, faceI)
01305     {
01306         if (dualRegion[faceI] >= 0)
01307         {
01308             patchSizes[dualRegion[faceI]]++;
01309         }
01310     }
01311 
01312     labelList patchStarts(patches.size(), 0);
01313 
01314     label faceI = nInternalFaces;
01315 
01316     forAll(patches, patchI)
01317     {
01318         patchStarts[patchI] = faceI;
01319 
01320         faceI += patchSizes[patchI];
01321     }
01322 
01323 
01324     Pout<< "nFaces:" << dualFaces.size()
01325         << " patchSizes:" << patchSizes
01326         << " patchStarts:" << patchStarts
01327         << endl;
01328 
01329 
01330     // Add patches. First add zero sized (since mesh still 0 size)
01331     List<polyPatch*> dualPatches(patches.size());
01332 
01333     forAll(patches, patchI)
01334     {
01335         const polyPatch& pp = patches[patchI];
01336 
01337         dualPatches[patchI] = pp.clone
01338         (
01339             boundaryMesh(),
01340             patchI,
01341             0, //patchSizes[patchI],
01342             0  //patchStarts[patchI]
01343         ).ptr();
01344     }
01345     addPatches(dualPatches);
01346 
01347     // Assign to mesh.
01348     resetPrimitives
01349     (
01350         xferMove(dualPoints),
01351         xferMove(dualFaces),
01352         xferMove(dualOwner),
01353         xferMove(dualNeighbour),
01354         patchSizes,
01355         patchStarts
01356     );
01357 }
01358 
01359 
01360 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
01361 
01362 // Construct from components
01363 Foam::polyDualMesh::polyDualMesh(const IOobject& io)
01364 :
01365     polyMesh(io),
01366     cellPoint_
01367     (
01368         IOobject
01369         (
01370             "cellPoint",
01371             time().findInstance(meshDir(), "cellPoint"),
01372             meshSubDir,
01373             *this,
01374             IOobject::MUST_READ,
01375             IOobject::NO_WRITE
01376         )
01377     ),
01378     boundaryFacePoint_
01379     (
01380         IOobject
01381         (
01382             "boundaryFacePoint",
01383             time().findInstance(meshDir(), "boundaryFacePoint"),
01384             meshSubDir,
01385             *this,
01386             IOobject::MUST_READ,
01387             IOobject::NO_WRITE
01388         )
01389     )
01390 {}
01391 
01392 
01393 // Construct from polyMesh
01394 Foam::polyDualMesh::polyDualMesh
01395 (
01396     const polyMesh& mesh,
01397     const labelList& featureEdges,
01398     const labelList& featurePoints
01399 )
01400 :
01401     polyMesh
01402     (
01403         mesh,
01404         xferCopy(pointField()),   // to prevent any warnings "points not allocated"
01405         xferCopy(faceList()),     // to prevent any warnings "faces  not allocated"
01406         xferCopy(cellList())
01407     ),
01408     cellPoint_
01409     (
01410         IOobject
01411         (
01412             "cellPoint",
01413             time().findInstance(meshDir(), "faces"),
01414             meshSubDir,
01415             *this,
01416             IOobject::NO_READ,
01417             IOobject::AUTO_WRITE
01418         ),
01419         labelList(mesh.nCells(), -1)
01420     ),
01421     boundaryFacePoint_
01422     (
01423         IOobject
01424         (
01425             "boundaryFacePoint",
01426             time().findInstance(meshDir(), "faces"),
01427             meshSubDir,
01428             *this,
01429             IOobject::NO_READ,
01430             IOobject::AUTO_WRITE
01431         ),
01432         labelList(mesh.nFaces() - mesh.nInternalFaces())
01433     )
01434 {
01435     calcDual(mesh, featureEdges, featurePoints);
01436 }
01437 
01438 
01439 // Construct from polyMesh and feature angle
01440 Foam::polyDualMesh::polyDualMesh
01441 (
01442     const polyMesh& mesh,
01443     const scalar featureCos
01444 )
01445 :
01446     polyMesh
01447     (
01448         mesh,
01449         xferCopy(pointField()),   // to prevent any warnings "points not allocated"
01450         xferCopy(faceList()),     // to prevent any warnings "faces  not allocated"
01451         xferCopy(cellList())
01452     ),
01453     cellPoint_
01454     (
01455         IOobject
01456         (
01457             "cellPoint",
01458             time().findInstance(meshDir(), "faces"),
01459             meshSubDir,
01460             *this,
01461             IOobject::NO_READ,
01462             IOobject::AUTO_WRITE
01463         ),
01464         labelList(mesh.nCells(), -1)
01465     ),
01466     boundaryFacePoint_
01467     (
01468         IOobject
01469         (
01470             "boundaryFacePoint",
01471             time().findInstance(meshDir(), "faces"),
01472             meshSubDir,
01473             *this,
01474             IOobject::NO_READ,
01475             IOobject::AUTO_WRITE
01476         ),
01477         labelList(mesh.nFaces() - mesh.nInternalFaces(), -1)
01478     )
01479 {
01480     labelList featureEdges, featurePoints;
01481 
01482     calcFeatures(mesh, featureCos, featureEdges, featurePoints);
01483     calcDual(mesh, featureEdges, featurePoints);
01484 }
01485 
01486 
01487 void Foam::polyDualMesh::calcFeatures
01488 (
01489     const polyMesh& mesh,
01490     const scalar featureCos,
01491     labelList& featureEdges,
01492     labelList& featurePoints
01493 )
01494 {
01495     // Create big primitivePatch for all outside.
01496     primitivePatch allBoundary
01497     (
01498         SubList<face>
01499         (
01500             mesh.faces(),
01501             mesh.nFaces() - mesh.nInternalFaces(),
01502             mesh.nInternalFaces()
01503         ),
01504         mesh.points()
01505     );
01506 
01507     // For ease of use store patch number per face in allBoundary.
01508     labelList allRegion(allBoundary.size());
01509 
01510     const polyBoundaryMesh& patches = mesh.boundaryMesh();
01511 
01512     forAll(patches, patchI)
01513     {
01514         const polyPatch& pp = patches[patchI];
01515 
01516         forAll(pp, i)
01517         {
01518             allRegion[i + pp.start() - mesh.nInternalFaces()] = patchI;
01519         }
01520     }
01521 
01522 
01523     // Calculate patch/feature edges
01524     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01525 
01526     const labelListList& edgeFaces = allBoundary.edgeFaces();
01527     const vectorField& faceNormals = allBoundary.faceNormals();
01528     const labelList& meshPoints = allBoundary.meshPoints();
01529 
01530     boolList isFeatureEdge(edgeFaces.size(), false);
01531 
01532     forAll(edgeFaces, edgeI)
01533     {
01534         const labelList& eFaces = edgeFaces[edgeI];
01535 
01536         if (eFaces.size() != 2)
01537         {
01538             // Non-manifold. Problem?
01539             const edge& e = allBoundary.edges()[edgeI];
01540 
01541             WarningIn("polyDualMesh::calcFeatures") << "Edge "
01542                 << meshPoints[e[0]] << ' ' << meshPoints[e[1]]
01543                 << "  coords:" << mesh.points()[meshPoints[e[0]]]
01544                 << mesh.points()[meshPoints[e[1]]]
01545                 << " has more than 2 faces connected to it:"
01546                 << eFaces.size() << endl;
01547 
01548             isFeatureEdge[edgeI] = true;
01549         }
01550         else if (allRegion[eFaces[0]] != allRegion[eFaces[1]])
01551         {
01552             isFeatureEdge[edgeI] = true;
01553         }
01554         else if
01555         (
01556             (faceNormals[eFaces[0]] & faceNormals[eFaces[1]])
01557           < featureCos
01558         )
01559         {
01560             isFeatureEdge[edgeI] = true;
01561         }
01562     }
01563 
01564 
01565     // Calculate feature points
01566     // ~~~~~~~~~~~~~~~~~~~~~~~~
01567 
01568     const labelListList& pointEdges = allBoundary.pointEdges();
01569 
01570     DynamicList<label> allFeaturePoints(pointEdges.size());
01571 
01572     forAll(pointEdges, pointI)
01573     {
01574         const labelList& pEdges = pointEdges[pointI];
01575 
01576         label nFeatEdges = 0;
01577 
01578         forAll(pEdges, i)
01579         {
01580             if (isFeatureEdge[pEdges[i]])
01581             {
01582                 nFeatEdges++;
01583             }
01584         }
01585         if (nFeatEdges > 2)
01586         {
01587             // Store in mesh vertex label
01588             allFeaturePoints.append(allBoundary.meshPoints()[pointI]);
01589         }
01590     }
01591     featurePoints.transfer(allFeaturePoints);
01592 
01593     if (debug)
01594     {
01595         OFstream str("featurePoints.obj");
01596 
01597         Pout<< "polyDualMesh::calcFeatures : dumping feature points to "
01598             << str.name() << endl;
01599 
01600         forAll(featurePoints, i)
01601         {
01602             label pointI = featurePoints[i];
01603             meshTools::writeOBJ(str, mesh.points()[pointI]);
01604         }
01605     }
01606 
01607 
01608     // Get all feature edges.
01609     labelList meshEdges
01610     (
01611         allBoundary.meshEdges
01612         (
01613             mesh.edges(),
01614             mesh.cellEdges(),
01615             SubList<label>
01616             (
01617                 mesh.faceOwner(),
01618                 allBoundary.size(),
01619                 mesh.nInternalFaces()
01620             )
01621         )
01622     );
01623 
01624     DynamicList<label> allFeatureEdges(isFeatureEdge.size());
01625     forAll(isFeatureEdge, edgeI)
01626     {
01627         if (isFeatureEdge[edgeI])
01628         {
01629             // Store in mesh edge label.
01630             allFeatureEdges.append(meshEdges[edgeI]);
01631         }
01632     }
01633     featureEdges.transfer(allFeatureEdges);
01634 }
01635 
01636 
01637 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
01638 
01639 Foam::polyDualMesh::~polyDualMesh()
01640 {}
01641 
01642 
01643 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd