Moved ragne insertion from std::vector<Point> to separate insertPoints function

so that it can be used by initial point insertions and insertions after point
motion.
This commit is contained in:
graham
2009-07-12 12:05:22 +01:00
parent 0f1e827467
commit c763c881f2
3 changed files with 57 additions and 23 deletions

View File

@ -28,8 +28,6 @@ License
#include "initialPointsMethod.H"
#include "relaxationModel.H"
#include "faceAreaWeightModel.H"
#include "uint.H"
#include "ulong.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -836,32 +834,34 @@ void Foam::conformalVoronoiMesh::insertInitialPoints()
{
startOfInternalPoints_ = number_of_vertices();
label nVert = startOfInternalPoints_;
Info<< nl << "Inserting initial points" << endl;
std::vector<Point> initialPoints = initialPointsMethod_->initialPoints();
insertPoints(initialPointsMethod_->initialPoints());
Info<< " " << initialPoints.size() << " points to insert..." << endl;
// std::vector<Point> initialPoints = initialPointsMethod_->initialPoints();
// using the range insert (faster than inserting points one by one)
insert(initialPoints.begin(), initialPoints.end());
// Info<< " " << initialPoints.size() << " points to insert..." << endl;
Info<< " " << number_of_vertices() - startOfInternalPoints_
<< " points inserted" << endl;
// label nVert = startOfInternalPoints_;
for
(
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
vit != finite_vertices_end();
++vit
)
{
if (vit->uninitialised())
{
vit->index() = nVert++;
}
}
// // using the range insert (faster than inserting points one by one)
// insert(initialPoints.begin(), initialPoints.end());
// Info<< " " << number_of_vertices() - startOfInternalPoints_
// << " points inserted" << endl;
// for
// (
// Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
// vit != finite_vertices_end();
// ++vit
// )
// {
// if (vit->uninitialised())
// {
// vit->index() = nVert++;
// }
// }
writePoints("initialPoints.obj", true);
}

View File

@ -41,7 +41,8 @@ SourceFiles
#define CGAL_HIERARCHY
#include "CGALTriangulation3Ddefs.H"
#include "uint.H"
#include "ulong.H"
#include "searchableSurfaces.H"
#include "conformationSurfaces.H"
#include "cellSizeControlSurfaces.H"
@ -171,6 +172,9 @@ class conformalVoronoiMesh
const label type
);
//- Insert a range of points using the CGAL range insertion method
inline void insertPoints(const std::vector<Point>& points);
//- Insert a point-pair at a ppDist distance either side of
// surface point surfPt, in the direction n
inline void insertPointPair

View File

@ -153,6 +153,36 @@ inline Foam::label Foam::conformalVoronoiMesh::insertPoint
}
inline void Foam::conformalVoronoiMesh::insertPoints
(
const std::vector<Point>& points
)
{
Info<< " " << points.size() << " points to insert..." << endl;
label nVert = number_of_vertices();
// using the range insert (faster than inserting points one by one)
insert(points.begin(), points.end());
Info<< " " << number_of_vertices() - startOfInternalPoints_
<< " points inserted" << endl;
for
(
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
vit != finite_vertices_end();
++vit
)
{
if (vit->uninitialised())
{
vit->index() = nVert++;
}
}
}
inline void Foam::conformalVoronoiMesh::insertPointPair
(
const scalar ppDist,