From 550fa20412159f34a31b3cfebcc360837eef651a Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 15 Oct 2008 19:07:46 +0100 Subject: [PATCH] WIP - reworking dualisation to remove small edges. --- .../mesh/generation/CV3DMesher/CV3D.H | 1 + .../mesh/generation/CV3DMesher/calcDualMesh.C | 60 ++++++++++++++++++- .../generation/CV3DMesher/indexedVertex.H | 2 +- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/applications/utilities/mesh/generation/CV3DMesher/CV3D.H b/applications/utilities/mesh/generation/CV3DMesher/CV3D.H index c2a837cb93..52c7f868ab 100644 --- a/applications/utilities/mesh/generation/CV3DMesher/CV3D.H +++ b/applications/utilities/mesh/generation/CV3DMesher/CV3D.H @@ -330,6 +330,7 @@ private: labelList& patchStarts ); + public: // Constructors diff --git a/applications/utilities/mesh/generation/CV3DMesher/calcDualMesh.C b/applications/utilities/mesh/generation/CV3DMesher/calcDualMesh.C index cd27ed36e4..927bf318e3 100644 --- a/applications/utilities/mesh/generation/CV3DMesher/calcDualMesh.C +++ b/applications/utilities/mesh/generation/CV3DMesher/calcDualMesh.C @@ -74,6 +74,9 @@ void Foam::CV3D::calcDualMesh // assigns an index to the vertices which will be the dual cell index used // for owner neighbour assignment + // The indices of the points are reset which destroys the point-pair + // matching, so the type of each vertex are reset to avoid any ambiguity. + label dualCelli = 0; for @@ -85,7 +88,7 @@ void Foam::CV3D::calcDualMesh { if (vit->internalOrBoundaryPoint()) { - //vit->type() = Vb::INTERNAL_POINT; + vit->type() = Vb::INTERNAL_POINT; vit->index() = dualCelli; dualCelli++; } @@ -96,6 +99,61 @@ void Foam::CV3D::calcDualMesh } } + // ~~~~~~~~~~~~ removing short edges by reindexing vertices ~~~~~~~~~~~~~~~~ + + 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() + ) + { + Cell_circulator ccStart = incident_cells(*eit); + Cell_circulator cc1 = ccStart; + Cell_circulator cc2 = cc1; + + // Advance the second circulator so that it always stays on the next + // cell around the edge; + cc2++; + + DynamicList