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