BUG: distributedTriSurfaceMesh: locally empty surface. Fixes #2612

This commit is contained in:
mattijs
2022-10-13 11:57:27 +01:00
parent 7fa4f1ef76
commit 6c6c8c5008

View File

@ -1650,8 +1650,8 @@ Foam::volumeType Foam::distributedTriSurfaceMesh::cachedVolumeType
// Recurse // Recurse
volumeType subType = cachedVolumeType volumeType subType = cachedVolumeType
( (
indexedOctree<treeDataTriSurface>::getNode(index), indexedOctree<treeDataTriSurface>::getNode(index),
sample sample
); );
return subType; return subType;
@ -4158,7 +4158,10 @@ void Foam::distributedTriSurfaceMesh::getVolumeType
// Collect midpoints // Collect midpoints
DynamicField<point> midPoints(label(0.5*nodes.size())); DynamicField<point> midPoints(label(0.5*nodes.size()));
collectLeafMids(0, midPoints); if (nodes.size())
{
collectLeafMids(0, midPoints);
}
if (debug) if (debug)
{ {
@ -4186,14 +4189,17 @@ void Foam::distributedTriSurfaceMesh::getVolumeType
} }
// Cache on local tree // Cache on local tree
label index = 0; if (nodes.size())
calcVolumeType {
( label index = 0;
midVolTypes, calcVolumeType
index, (
nt, midVolTypes,
0 // nodeI index,
); nt,
0 // nodeI
);
}
if (debug) if (debug)
{ {
Pout<< "distributedTriSurfaceMesh::getVolumeType :" Pout<< "distributedTriSurfaceMesh::getVolumeType :"
@ -4290,7 +4296,10 @@ void Foam::distributedTriSurfaceMesh::getVolumeType
DynamicList<label> fullSearchMap(localPoints.size()); DynamicList<label> fullSearchMap(localPoints.size());
forAll(localPoints, i) forAll(localPoints, i)
{ {
volType[i] = cachedVolumeType(0, localPoints[i]); if (tree().nodes().size())
{
volType[i] = cachedVolumeType(0, localPoints[i]);
}
if (volType[i] == volumeType::UNKNOWN) if (volType[i] == volumeType::UNKNOWN)
{ {
fullSearchMap.append(i); fullSearchMap.append(i);