mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: ptscotchDecomp: handle locally zero cells
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -531,6 +531,8 @@ Foam::label Foam::ptscotchDecomp::decompose
|
||||
Pstream::scatter(rangeScale);
|
||||
|
||||
if (maxWeights > minWeights)
|
||||
{
|
||||
if (cWeights.size())
|
||||
{
|
||||
// Convert to integers.
|
||||
velotab.setSize(cWeights.size());
|
||||
@ -540,6 +542,15 @@ Foam::label Foam::ptscotchDecomp::decompose
|
||||
velotab[i] = int((cWeights[i]/minWeights - 1)*rangeScale) + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Locally zero cells but not globally. Make sure we have
|
||||
// some size so .begin() does not return null pointer. Data
|
||||
// itself is never used.
|
||||
velotab.setSize(1);
|
||||
velotab[0] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user