BUG: When distributing mesh vertices check return values for locate

This commit is contained in:
laurence
2013-05-17 09:56:12 +01:00
parent 6d12b2d4f0
commit f925f93eab

View File

@ -843,6 +843,8 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
// Locate the point // Locate the point
Cell_handle c = Triangulation::locate(pointToInsert, lt, li, lj, hint); Cell_handle c = Triangulation::locate(pointToInsert, lt, li, lj, hint);
bool inserted = false;
if (lt == Triangulation::VERTEX) if (lt == Triangulation::VERTEX)
{ {
if (printErrors) if (printErrors)
@ -854,13 +856,24 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
<< "Failed insertion : " << vert.info() << "Failed insertion : " << vert.info()
<< " nearest : " << nearV->info(); << " nearest : " << nearV->info();
} }
uninserted.insert(labelPair(vert.procIndex(), vert.index()));
nNotInserted++;
continue;
} }
else if (lt == Triangulation::OUTSIDE_CONVEX_HULL)
{
hint = this->insert(pointToInsert, hint);
inserted = true;
}
else if (lt == Triangulation::OUTSIDE_AFFINE_HULL)
{
WarningIn
(
"Foam::DistributedDelaunayMesh<Triangulation>"
"::rangeInsertReferredWithInfo"
) << "Point is outside affine hull! pt = " << pointToInsert
<< endl;
}
else
{
// Get the cells that conflict with p in a vector V, // Get the cells that conflict with p in a vector V,
// and a facet on the boundary of this hole in f. // and a facet on the boundary of this hole in f.
std::vector<Cell_handle> V; std::vector<Cell_handle> V;
@ -874,17 +887,9 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
std::back_inserter(V) std::back_inserter(V)
); );
bool insert = false;
for (size_t i = 0; i < V.size(); ++i) for (size_t i = 0; i < V.size(); ++i)
{ {
if (V[i]->real() || V[i]->hasFarPoint()) if (V[i]->real() || V[i]->hasFarPoint())
{
insert = true;
break;
}
}
if (insert)
{ {
hint = Triangulation::insert_in_hole hint = Triangulation::insert_in_hole
( (
@ -895,6 +900,15 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
f.second f.second
); );
inserted = true;
break;
}
}
}
if (inserted)
{
if (checkInsertion != Triangulation::number_of_vertices() - 1) if (checkInsertion != Triangulation::number_of_vertices() - 1)
{ {
if (printErrors) if (printErrors)