mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: distributedTriSurfaceMesh: handle zero sized local surfaces
This commit is contained in:
@ -433,24 +433,28 @@ Foam::triSurfaceMesh::edgeTree() const
|
||||
+ nInternalEdges()
|
||||
);
|
||||
|
||||
treeBoundBox bb;
|
||||
label nPoints;
|
||||
PatchTools::calcBounds
|
||||
(
|
||||
static_cast<const triSurface&>(*this),
|
||||
bb,
|
||||
nPoints
|
||||
);
|
||||
treeBoundBox bb(vector::zero, vector::zero);
|
||||
|
||||
// Random number generator. Bit dodgy since not exactly random ;-)
|
||||
Random rndGen(65431);
|
||||
if (bEdges.size())
|
||||
{
|
||||
label nPoints;
|
||||
PatchTools::calcBounds
|
||||
(
|
||||
static_cast<const triSurface&>(*this),
|
||||
bb,
|
||||
nPoints
|
||||
);
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
// Random number generator. Bit dodgy since not exactly random ;-)
|
||||
Random rndGen(65431);
|
||||
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
}
|
||||
|
||||
scalar oldTol = indexedOctree<treeDataEdge>::perturbTol();
|
||||
indexedOctree<treeDataEdge>::perturbTol() = tolerance();
|
||||
|
||||
@ -121,33 +121,40 @@ Foam::triSurfaceRegionSearch::treeByRegion() const
|
||||
);
|
||||
|
||||
// Calculate bb without constructing local point numbering.
|
||||
treeBoundBox bb;
|
||||
label nPoints;
|
||||
PatchTools::calcBounds
|
||||
(
|
||||
indirectRegionPatches_[regionI],
|
||||
bb,
|
||||
nPoints
|
||||
);
|
||||
treeBoundBox bb(vector::zero, vector::zero);
|
||||
|
||||
// if (nPoints != surface().points().size())
|
||||
// {
|
||||
// WarningIn("triSurfaceRegionSearch::treeByRegion() const")
|
||||
// << "Surface does not have compact point numbering. "
|
||||
// << "Of " << surface().points().size()
|
||||
// << " only " << nPoints
|
||||
// << " are used. This might give problems in some routines."
|
||||
// << endl;
|
||||
// }
|
||||
if (indirectRegionPatches_[regionI].size())
|
||||
{
|
||||
label nPoints;
|
||||
PatchTools::calcBounds
|
||||
(
|
||||
indirectRegionPatches_[regionI],
|
||||
bb,
|
||||
nPoints
|
||||
);
|
||||
|
||||
// Random number generator. Bit dodgy since not exactly random ;-)
|
||||
Random rndGen(65431);
|
||||
// if (nPoints != surface().points().size())
|
||||
// {
|
||||
// WarningIn("triSurfaceRegionSearch::treeByRegion() const")
|
||||
// << "Surface does not have compact point numbering. "
|
||||
// << "Of " << surface().points().size()
|
||||
// << " only " << nPoints
|
||||
// << " are used."
|
||||
// << " This might give problems in some routines."
|
||||
// << endl;
|
||||
// }
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are fewer face/edge aligned items.
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
// Random number generator. Bit dodgy since not exactly
|
||||
// random ;-)
|
||||
Random rndGen(65431);
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so
|
||||
// on symmetric geometry there are fewer face/edge
|
||||
// aligned items.
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
}
|
||||
|
||||
treeByRegion_.set
|
||||
(
|
||||
|
||||
@ -200,28 +200,33 @@ Foam::triSurfaceSearch::tree() const
|
||||
if (treePtr_.empty())
|
||||
{
|
||||
// Calculate bb without constructing local point numbering.
|
||||
treeBoundBox bb;
|
||||
label nPoints;
|
||||
PatchTools::calcBounds(surface(), bb, nPoints);
|
||||
treeBoundBox bb(vector::zero, vector::zero);
|
||||
|
||||
if (nPoints != surface().points().size())
|
||||
if (surface().size())
|
||||
{
|
||||
WarningIn("triSurfaceSearch::tree() const")
|
||||
<< "Surface does not have compact point numbering."
|
||||
<< " Of " << surface().points().size() << " only " << nPoints
|
||||
<< " are used. This might give problems in some routines."
|
||||
<< endl;
|
||||
label nPoints;
|
||||
PatchTools::calcBounds(surface(), bb, nPoints);
|
||||
|
||||
if (nPoints != surface().points().size())
|
||||
{
|
||||
WarningIn("triSurfaceSearch::tree() const")
|
||||
<< "Surface does not have compact point numbering."
|
||||
<< " Of " << surface().points().size()
|
||||
<< " only " << nPoints
|
||||
<< " are used. This might give problems in some routines."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Random number generator. Bit dodgy since not exactly random ;-)
|
||||
Random rndGen(65431);
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
}
|
||||
|
||||
// Random number generator. Bit dodgy since not exactly random ;-)
|
||||
Random rndGen(65431);
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
bb = bb.extend(rndGen, 1e-4);
|
||||
bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
scalar oldTol = indexedOctree<treeDataTriSurface>::perturbTol();
|
||||
indexedOctree<treeDataTriSurface>::perturbTol() = tolerance_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user