ENH: Controllable first stage referral.

Bound box extension to avoid flat conformations on flat surfaces being missed.

Supplying names for obj output per iteration.
This commit is contained in:
graham
2011-03-30 16:24:02 +01:00
parent e9b5e60824
commit 9badaf93a0
5 changed files with 31 additions and 17 deletions

View File

@ -793,7 +793,7 @@ Foam::conformalVoronoiMesh::featurePointTree() const
{
treeBoundBox overallBb
(
geometryToConformTo_.globalBounds().extend(rndGen_, 1E-4)
geometryToConformTo_.globalBounds().extend(rndGen_, 1e-4)
);
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);

View File

@ -442,7 +442,9 @@ private:
void buildParallelInterface
(
List<labelHashSet>& referralVertices,
List<labelHashSet>& receivedVertices
List<labelHashSet>& receivedVertices,
bool initialEdgeReferrral,
const word& outputName
);
//- Build map to refer vertices to target processors

View File

@ -228,7 +228,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
List<labelHashSet> receivedVertices(Pstream::nProcs());
// Build the parallel interface the initial surface conformation
buildParallelInterface(referralVertices, receivedVertices);
buildParallelInterface(referralVertices, receivedVertices, true, "initial");
label iterationNo = 0;
@ -387,6 +387,15 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
timeCheck("Conformation iteration " + name(iterationNo));
// Update the parallel interface
buildParallelInterface
(
referralVertices,
receivedVertices,
false,
name(iterationNo)
);
iterationNo++;
if (iterationNo == maxIterations)
@ -403,8 +412,6 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
<< "), stopping iterations" << endl;
}
// Update the parallel interface
buildParallelInterface(referralVertices, receivedVertices);
}
// reportSurfaceConformationQuality();
@ -546,7 +553,9 @@ bool Foam::conformalVoronoiMesh::clipLineToBox
void Foam::conformalVoronoiMesh::buildParallelInterface
(
List<labelHashSet>& referralVertices,
List<labelHashSet>& receivedVertices
List<labelHashSet>& receivedVertices,
bool initialEdgeReferrral,
const word& outputName
)
{
if (!Pstream::parRun())
@ -632,7 +641,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
// {
// writePoints
// (
// "parallelAllPointsReceived.obj",
// "parallelAllPointsReceived_" + outputName + ".obj",
// parallelAllPoints
// );
// }
@ -672,6 +681,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
// }
if (initialEdgeReferrral)
{
DynamicList<Foam::point> parallelIntersectionPoints;
DynamicList<label> targetProcessor;
@ -728,7 +738,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
{
writePoints
(
"parallelIntersectionPointsToSend.obj",
"parallelIntersectionPointsToSend_" + outputName + ".obj",
parallelIntersectionPoints
);
}
@ -747,7 +757,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
{
writePoints
(
"parallelIntersectionPointsReceived.obj",
"parallelIntersectionPointsReceived_" + outputName + ".obj",
parallelIntersectionPoints
);
}
@ -843,7 +853,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
{
writePoints
(
"parallelInfluencePointsToSend.obj",
"parallelInfluencePointsToSend_" + outputName + ".obj",
parallelInfluencePoints
);
}
@ -862,7 +872,7 @@ void Foam::conformalVoronoiMesh::buildParallelInterface
{
writePoints
(
"parallelInfluencePointsReceived.obj",
"parallelInfluencePointsReceived_" + outputName + ".obj",
parallelInfluencePoints
);
}
@ -1567,7 +1577,7 @@ void Foam::conformalVoronoiMesh::buildEdgeLocationTree
{
treeBoundBox overallBb
(
geometryToConformTo_.globalBounds().extend(rndGen_, 1E-4)
geometryToConformTo_.globalBounds().extend(rndGen_, 1e-4)
);
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
@ -1591,7 +1601,7 @@ void Foam::conformalVoronoiMesh::buildSizeAndAlignmentTree() const
{
treeBoundBox overallBb
(
geometryToConformTo_.globalBounds().extend(rndGen_, 1E-4)
geometryToConformTo_.globalBounds().extend(rndGen_, 1e-4)
);
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);

View File

@ -222,8 +222,7 @@ inline Foam::label Foam::conformalVoronoiMesh::insertPoint
if (nVert == number_of_vertices())
{
WarningIn("Foam::conformalVoronoiMesh::insertPoint")
<< "Failed to insert point " << p << endl;
Pout << "Failed to insert point " << p << endl;
}
else
{
@ -248,8 +247,7 @@ inline void Foam::conformalVoronoiMesh::insertPoint
if (nVert == number_of_vertices())
{
WarningIn("Foam::conformalVoronoiMesh::insertPoint")
<< "Failed to insert point " << p << endl;
Pout << "Failed to insert point " << p << endl;
}
else
{

View File

@ -240,6 +240,10 @@ Foam::conformationSurfaces::conformationSurfaces
searchableSurfacesQueries::bounds(allGeometry_, surfaces_)
);
// Extend the global bounds to stop the bound box sitting on the surfaces
// to be conformed to
globalBounds_ = globalBounds_.extend(cvMesh_.rndGen(), 1e-4);
if (Pstream::parRun())
{
label procLimit = 8;