ENH: Robustness and correctness improvements.

This commit is contained in:
graham
2011-03-16 14:10:45 +00:00
parent 25cfcf1476
commit 6244a72748
4 changed files with 41 additions and 38 deletions

View File

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

View File

@ -1793,6 +1793,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
{
patchNames = geometryToConformTo_.patchNames();
patchTypes.setSize(patchNames.size(), wallPolyPatch::typeName);
procNeighbours.setSize(patchNames.size(), -1);
label nProcPatches = 0;
@ -1825,10 +1826,9 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
label nNonProcPatches = patchNames.size();
patchTypes.setSize(nNonProcPatches + nProcPatches);
procNeighbours.setSize(nNonProcPatches + nProcPatches, -1);
patchNames.setSize(nNonProcPatches + nProcPatches);
procNeighbours.setSize(patchNames.size() + 1, -1);
label procAddI = 0;
forAll(procUsed, pUI)
@ -1852,11 +1852,13 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
}
patchTypes.setSize(patchNames.size() + 1);
procNeighbours.setSize(patchNames.size() + 1);
patchNames.setSize(patchNames.size() + 1);
label defaultPatchIndex = patchNames.size() - 1;
patchTypes[defaultPatchIndex] = wallPolyPatch::typeName;
procNeighbours[defaultPatchIndex] = -1;
patchNames[defaultPatchIndex] = "cvMesh_defaultPatch";
Pout<< patchTypes << " " << patchNames << endl;

View File

@ -153,6 +153,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
);
// Pout<< "vert " << vert << endl;
// Pout<< " surfHit " << surfHit << endl;
if (surfHit.hit())
{
@ -178,8 +179,6 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
);
}
}
// Pout<< " surfHit " << surfHit << endl;
}
}
@ -417,6 +416,8 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
vit != finite_vertices_end();
vit++
)
{
if (!vit->referred())
{
// If a vertex has been marked to go to another processor,
// then send it
@ -430,7 +431,10 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
{
forAll(vertexToProc, vTPI)
{
parallelInterfacePoints.append(topoint(vit->point()));
parallelInterfacePoints.append
(
topoint(vit->point())
);
targetProcessor.append(vertexToProc[vTPI]);
@ -445,10 +449,11 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
}
}
}
}
writePoints
(
"parallelInterfacePointsToSend.obj",
"parallelInterfacePointsToSend_" + name(nIter) + ".obj",
parallelInterfacePoints
);
@ -537,7 +542,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation
writePoints
(
"parallelInterfacePointsReceived.obj",
"parallelInterfacePointsReceived_"+ name(nIter) + ".obj",
parallelInterfacePoints
);
@ -872,7 +877,7 @@ bool Foam::conformalVoronoiMesh::dualCellSurfaceAnyIntersection
|| is_infinite(fit->first->neighbor(fit->second))
)
{
return true;
continue;
}
Foam::point dE0 = topoint(dual(fit->first));
@ -913,7 +918,7 @@ Foam::conformalVoronoiMesh::parallelInterfaceIntersection
|| is_infinite(fit->first->neighbor(fit->second))
)
{
return procs;
continue;
}
Foam::point dE0 = topoint(dual(fit->first));
@ -957,7 +962,7 @@ Foam::conformalVoronoiMesh::parallelInterfaceIntersection
// meshTools::writeOBJ(Pout, dE0);
// meshTools::writeOBJ(Pout, dE1);
// meshTools::writeOBJ(Pout, boxPt);
// Pout << "l 1 2" << endl;
// Pout << "l dE0 dE1" << endl;
}
}
@ -1290,7 +1295,7 @@ void Foam::conformalVoronoiMesh::buildEdgeLocationTree
{
treeBoundBox overallBb
(
treeBoundBox(geometryToConformTo_.bounds()).extend(rndGen_, 1E-4)
geometryToConformTo_.globalBounds().extend(rndGen_, 1E-4)
);
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
@ -1314,7 +1319,7 @@ void Foam::conformalVoronoiMesh::buildSizeAndAlignmentTree() const
{
treeBoundBox overallBb
(
treeBoundBox(geometryToConformTo_.bounds()).extend(rndGen_, 1E-4)
geometryToConformTo_.globalBounds().extend(rndGen_, 1E-4)
);
overallBb.min() -= Foam::point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);

View File

@ -765,11 +765,7 @@ hierarchicalDensityWeightedStochastic::initialPoints() const
{
const conformationSurfaces& geometry = cvMesh_.geometryToConformTo();
treeBoundBox hierBB = treeBoundBox(geometry.bounds()).extend
(
cvMesh_.rndGen(),
1E-4
);
treeBoundBox hierBB = geometry.bounds().extend(cvMesh_.rndGen(), 1e-6);
std::vector<Vb::Point> initialPoints;