From cf0c71789ae9f7e53f6a9ab89cd6c685092ffaac Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 13 Jan 2010 16:12:05 +0000 Subject: [PATCH] Adding filter limit scalars to the Delaunay cells. After initial face check, identifying faces that have bad quality, identifying the points that support the faces, and 'limiting' them. Wrong faces are also those that are attached to a cell with 1-3 faces. At each iteration of filtering, the Delaunay cells are all reindexed. Now a separate function. Currently 'limiting' means: do not collapse any face that has any vertex that has been limited at all and do not move a vertex to the boundary during the surface smooth if it has been limited. This is the most agressive form of limiting and leaves faces in the mesh that might be safely removed with an less aggressive filter. Limiting of all points connected to a cell which has a limited point could be used (comment out code). Removed some redundant code from indexedCell. --- .../conformalVoronoiMesh.C | 40 +++ .../conformalVoronoiMesh.H | 12 + .../conformalVoronoiMeshCalcDualMesh.C | 271 ++++++++++++++---- .../conformalVoronoiMesh/indexedCell.H | 60 ++-- .../conformalVoronoiMesh/indexedVertex.H | 28 +- src/mesh/conformalVoronoiMesh/log | 20 -- 6 files changed, 321 insertions(+), 110 deletions(-) delete mode 100644 src/mesh/conformalVoronoiMesh/log diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index fd1e5c4d42..e146e488a0 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -1030,6 +1030,46 @@ Foam::face Foam::conformalVoronoiMesh::buildDualFace } +Foam::scalar Foam::conformalVoronoiMesh::minFilterLimit +( + const Triangulation::Finite_edges_iterator& eit +) const +{ + Cell_circulator ccStart = incident_cells(*eit); + Cell_circulator cc = ccStart; + + scalar minFilterLimit = GREAT; + + do + { + if (cc->cellIndex() < 0) + { + Cell_handle c = eit->first; + Vertex_handle vA = c->vertex(eit->second); + Vertex_handle vB = c->vertex(eit->third); + + FatalErrorIn("Foam::conformalVoronoiMesh::buildDualFace") + << "Dual face uses circumcenter defined by a " + << "Delaunay tetrahedron with no internal " + << "or boundary points. Defining Delaunay edge ends: " + << topoint(vA->point()) << " " + << topoint(vB->point()) << nl + << exit(FatalError); + } + + if (cc->filterLimit() < minFilterLimit) + { + minFilterLimit = cc->filterLimit(); + } + + cc++; + + } while (cc != ccStart); + + return minFilterLimit; +} + + bool Foam::conformalVoronoiMesh::ownerAndNeighbour ( Vertex_handle vA, diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 9e9c45fee7..095ddc5a18 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -357,6 +357,14 @@ private: const Triangulation::Finite_edges_iterator& eit ) const; + //- Finds the minimum filterLimit of the dual vertices + // (Delaunay cells) that form the dual face produced by the + // supplied edge + scalar minFilterLimit + ( + const Triangulation::Finite_edges_iterator& eit + ) const; + //- Determines the owner and neighbour labels for dual cells // corresponding to the dual face formed by the supplied // Delaunay vertices. If the dual face is a boundary face @@ -552,6 +560,10 @@ private: // elements damage the mesh quality, allowing backtracking. label checkPolyMeshQuality(const pointField& pts) const; + //- Index all of the the Delaunay cells and calculate their + //- dual points + void indexDualVertices(pointField& pts); + //- Re-index all of the the Delaunay cells void reindexDualVertices(const Map