From 8f4065051c8c090b1deb88f2baabf42f79dc99fd Mon Sep 17 00:00:00 2001 From: graham Date: Mon, 16 Nov 2009 18:54:15 +0000 Subject: [PATCH] Creating a buildDualFace function, using everywhere a dual face is required. Separating dual face creation into two loops - first one to loop over the dual faces and collapse the points of those that are to be removed, second one to create the faces that remain. --- .../conformalVoronoiMesh.C | 188 ++++++++++-------- .../conformalVoronoiMesh.H | 19 +- 2 files changed, 128 insertions(+), 79 deletions(-) diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 9df248939a..4978ae356d 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -1766,7 +1766,8 @@ void Foam::conformalVoronoiMesh::calcDualMesh timeCheck(); - // Indexing cells, which are Dual vertices + // Indexing Delaunay cells, which are Dual vertices + label dualVertI = 0; points.setSize(number_of_cells()); @@ -2042,6 +2043,38 @@ void Foam::conformalVoronoiMesh::calcDualMesh } } + // ~~~~~~~~~~~~~~~~~~~~~~~~~ dual face filtering ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Loop over all dual faces and merge points to remove faces that + // are not wanted. + + for + ( + Triangulation::Finite_edges_iterator eit = finite_edges_begin(); + eit != finite_edges_end(); + ++eit + ) + { + Cell_handle c = eit->first; + Vertex_handle vA = c->vertex(eit->second); + Vertex_handle vB = c->vertex(eit->third); + + if + ( + vA->internalOrBoundaryPoint() + || vB->internalOrBoundaryPoint() + ) + { + face newDualFace = buildDualFace(eit); + + bool keepFace = assessFace(newDualFace, vA, vB, points); + + if (!keepFace) + { + + } + } + } + // ~~~~~~~~~~~~ dual face and owner neighbour construction ~~~~~~~~~~~~~~~~~ patchNames = geometryToConformTo_.patchNames(); @@ -2081,55 +2114,9 @@ void Foam::conformalVoronoiMesh::calcDualMesh || vB->internalOrBoundaryPoint() ) { - Cell_circulator ccStart = incident_cells(*eit); - Cell_circulator cc1 = ccStart; - Cell_circulator cc2 = cc1; + face newDualFace = buildDualFace(eit); - // Advance the second circulator so that it always stays on the next - // cell around the edge; - cc2++; - - DynamicList