mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -28,8 +28,6 @@ License
|
|||||||
#include "initialPointsMethod.H"
|
#include "initialPointsMethod.H"
|
||||||
#include "relaxationModel.H"
|
#include "relaxationModel.H"
|
||||||
#include "faceAreaWeightModel.H"
|
#include "faceAreaWeightModel.H"
|
||||||
#include "uint.H"
|
|
||||||
#include "ulong.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -836,32 +834,34 @@ void Foam::conformalVoronoiMesh::insertInitialPoints()
|
|||||||
{
|
{
|
||||||
startOfInternalPoints_ = number_of_vertices();
|
startOfInternalPoints_ = number_of_vertices();
|
||||||
|
|
||||||
label nVert = startOfInternalPoints_;
|
|
||||||
|
|
||||||
Info<< nl << "Inserting initial points" << endl;
|
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)
|
// Info<< " " << initialPoints.size() << " points to insert..." << endl;
|
||||||
insert(initialPoints.begin(), initialPoints.end());
|
|
||||||
|
|
||||||
Info<< " " << number_of_vertices() - startOfInternalPoints_
|
// label nVert = startOfInternalPoints_;
|
||||||
<< " points inserted" << endl;
|
|
||||||
|
|
||||||
for
|
// // using the range insert (faster than inserting points one by one)
|
||||||
(
|
// insert(initialPoints.begin(), initialPoints.end());
|
||||||
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
|
|
||||||
vit != finite_vertices_end();
|
// Info<< " " << number_of_vertices() - startOfInternalPoints_
|
||||||
++vit
|
// << " points inserted" << endl;
|
||||||
)
|
|
||||||
{
|
// for
|
||||||
if (vit->uninitialised())
|
// (
|
||||||
{
|
// Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
|
||||||
vit->index() = nVert++;
|
// vit != finite_vertices_end();
|
||||||
}
|
// ++vit
|
||||||
}
|
// )
|
||||||
|
// {
|
||||||
|
// if (vit->uninitialised())
|
||||||
|
// {
|
||||||
|
// vit->index() = nVert++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
writePoints("initialPoints.obj", true);
|
writePoints("initialPoints.obj", true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,8 @@ SourceFiles
|
|||||||
#define CGAL_HIERARCHY
|
#define CGAL_HIERARCHY
|
||||||
|
|
||||||
#include "CGALTriangulation3Ddefs.H"
|
#include "CGALTriangulation3Ddefs.H"
|
||||||
|
#include "uint.H"
|
||||||
|
#include "ulong.H"
|
||||||
#include "searchableSurfaces.H"
|
#include "searchableSurfaces.H"
|
||||||
#include "conformationSurfaces.H"
|
#include "conformationSurfaces.H"
|
||||||
#include "cellSizeControlSurfaces.H"
|
#include "cellSizeControlSurfaces.H"
|
||||||
@ -171,6 +172,9 @@ class conformalVoronoiMesh
|
|||||||
const label type
|
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
|
//- Insert a point-pair at a ppDist distance either side of
|
||||||
// surface point surfPt, in the direction n
|
// surface point surfPt, in the direction n
|
||||||
inline void insertPointPair
|
inline void insertPointPair
|
||||||
|
|||||||
@ -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
|
inline void Foam::conformalVoronoiMesh::insertPointPair
|
||||||
(
|
(
|
||||||
const scalar ppDist,
|
const scalar ppDist,
|
||||||
|
|||||||
Reference in New Issue
Block a user