From 1f61715738cf805bbbf9b5c126060aba5c802c22 Mon Sep 17 00:00:00 2001 From: graham Date: Thu, 16 Jun 2011 14:57:54 +0100 Subject: [PATCH] ENH: Distributing and storing feature points, surface conformation and sizes. --- .../conformalVoronoiMesh.C | 178 +++++++++++++----- .../conformalVoronoiMesh.H | 40 +++- .../conformalVoronoiMeshConformToSurface.C | 51 ++++- .../conformalVoronoiMeshI.H | 60 +++--- .../conformalVoronoiMesh/indexedVertex.H | 67 +++---- 5 files changed, 266 insertions(+), 130 deletions(-) diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 5157f3c580..208dba1083 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -283,7 +283,7 @@ void Foam::conformalVoronoiMesh::insertPoints // ++pit // ) // { - // insertVb(*pit); + // insertPoint(topoint(*pit), Vb::ptInternalPoint); // } label nInserted(number_of_vertices() - preInsertionSize); @@ -318,6 +318,10 @@ void Foam::conformalVoronoiMesh::insertPoints bool distribute ) { + // The pts, indices and types lists must be intact and up-to-date at the + // end of this function as they may also be used by other functions + // subsequently. + if (Pstream::parRun() && distribute) { // The link between vertices that form the boundary via pairs cannot be @@ -363,7 +367,6 @@ void Foam::conformalVoronoiMesh::insertPoints if (type > Vb::ptFarPoint) { // This is a member of a point pair, don't use the type directly - type += number_of_vertices(); } @@ -750,6 +753,7 @@ void Foam::conformalVoronoiMesh::insertFeaturePoints() createMixedFeaturePoints(pts, indices, types); + // Insert the created points, distributing to the appropriate processor insertPoints(pts, indices, types, true); if(cvMeshControls().objOutput()) @@ -770,27 +774,15 @@ void Foam::conformalVoronoiMesh::insertFeaturePoints() << " feature vertices" << endl; } - Info<< "SORT OUT FEATURE POINT DISTRIBUTION AND STORAGE" << endl; + featureVertices_.clear(); - // featureVertices_.setSize(number_of_vertices()); - - // label featPtI = 0; - - // for - // ( - // Delaunay::Finite_vertices_iterator vit = finite_vertices_begin(); - // vit != finite_vertices_end(); - // vit++ - // ) - // { - // featureVertices_[featPtI] = Vb(vit->point()); - - // featureVertices_[featPtI].index() = vit->index(); - - // featureVertices_[featPtI].type() = vit->type(); - - // featPtI++; - // } + forAll(pts, pI) + { + featureVertices_.push_back + ( + Vb(toPoint(pts[pI]), indices[pI], types[pI]) + ); + } constructFeaturePointLocations(); } @@ -1066,14 +1058,72 @@ void Foam::conformalVoronoiMesh::constructFeaturePointLocations() } -void Foam::conformalVoronoiMesh::reinsertFeaturePoints() +void Foam::conformalVoronoiMesh::reinsertFeaturePoints(bool distribute) { Info<< nl << "Reinserting stored feature points" << endl; - forAll(featureVertices_, f) + label preReinsertionSize(number_of_vertices()); + + if (distribute) { - insertVb(featureVertices_[f]); + DynamicList pointsToInsert; + DynamicList