Commit c574abb2 authored by laurence's avatar laurence
Browse files

ENH: foamyHexMesh: Edge conformation improvements

parent 0004dc6d
......@@ -764,6 +764,7 @@ private:
pointIndexHitAndFeatureDynList& featureEdgeHits,
DynamicList<label>& surfaceToTreeShape,
DynamicList<label>& edgeToTreeShape,
Map<scalar>& surfacePtToEdgePtDist,
bool firstPass
) const;
......
......@@ -298,6 +298,8 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
DynamicList<label> edgeToTreeShape(AtoV/4);
DynamicList<label> surfaceToTreeShape(AtoV);
Map<scalar> surfacePtToEdgePtDist(AtoV/4);
for
(
Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
......@@ -332,6 +334,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
featureEdgeHits,
surfaceToTreeShape,
edgeToTreeShape,
surfacePtToEdgePtDist,
true
);
}
......@@ -463,6 +466,8 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
DynamicList<label> surfaceToTreeShape(AtoV/2);
DynamicList<label> edgeToTreeShape(AtoV/4);
Map<scalar> surfacePtToEdgePtDist;
for
(
Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
......@@ -507,6 +512,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
featureEdgeHits,
surfaceToTreeShape,
edgeToTreeShape,
surfacePtToEdgePtDist,
false
);
}
......@@ -552,6 +558,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
featureEdgeHits,
surfaceToTreeShape,
edgeToTreeShape,
surfacePtToEdgePtDist,
false
);
}
......@@ -630,6 +637,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
featureEdgeHits,
surfaceToTreeShape,
edgeToTreeShape,
surfacePtToEdgePtDist,
false
);
}
......@@ -2089,6 +2097,7 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
pointIndexHitAndFeatureDynList& featureEdgeHits,
DynamicList<label>& surfaceToTreeShape,
DynamicList<label>& edgeToTreeShape,
Map<scalar>& surfacePtToEdgePtDist,
bool firstPass
) const
{
......@@ -2195,60 +2204,47 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
(
pointIndexHitAndFeature(edHit, featureHit)
);
// Info<< "Add " << existingEdgeLocations_.size() - 1
// << " " << magSqr(edPt - surfPt) << endl;
surfacePtToEdgePtDist.insert
(
existingEdgeLocations_.size() - 1,
magSqr(edPt - surfPt)
);
}
else if (firstPass)
{
label hitIndex = nearestEdgeHit.index();
// Info<< "Close to " << nearestEdgeHit << endl;
if
(
magSqr(edPt - surfPt)
< surfacePtToEdgePtDist[hitIndex]
)
{
featureEdgeHits[hitIndex] =
pointIndexHitAndFeature(edHit, featureHit);
existingEdgeLocations_[hitIndex] =
edHit.hitPoint();
surfacePtToEdgePtDist[hitIndex] =
magSqr(edPt - surfPt);
// Change edge location in featureEdgeHits
// remove index from edge tree
// reinsert new point into tree
edgeLocationTreePtr_().remove(hitIndex);
edgeLocationTreePtr_().insert
(
hitIndex,
hitIndex + 1
);
}
}
// else if (firstPass)
// {
// label hitIndex = nearestEdgeHit.index();
//
// // Calc new edge location
//// Foam::point newPt =
//// 0.5
//// *(
//// nearestEdgeHit.hitPoint()
//// + edHit.hitPoint()
//// );
//
// pointIndexHit pHitOld =
// edgeLocationTreePtr_().findNearest
// (
// nearestEdgeHit.hitPoint(), GREAT
// );
//
// pointIndexHit pHitNew =
// edgeLocationTreePtr_().findNearest
// (
// edHit.hitPoint(), GREAT
// );
//
// if
// (
// magSqr(pHitNew.hitPoint() - edHit.hitPoint())
// < magSqr
// (
// pHitOld.hitPoint()
// - nearestEdgeHit.hitPoint()
// )
// )
// {
// edHit.setPoint(edHit.hitPoint());
//
// featureEdgeHits[hitIndex] =
// pointIndexHitAndFeature(edHit, featureHit);
//
// existingEdgeLocations_[hitIndex] =
// edHit.hitPoint();
//
// // Change edge location in featureEdgeHits
// // remove index from edge tree
// // reinsert new point into tree
// edgeLocationTreePtr_().remove(hitIndex);
// edgeLocationTreePtr_().insert
// (
// hitIndex,
// hitIndex + 1
// );
// }
// }
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment