diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index 7a2ec4948d..1fb105cf4f 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -295,6 +295,25 @@ Foam::label Foam::ptscotchDecomp::decompose velotab.resize(1, 1); } } + else + { + // HACK: specify uniform weights + // - seems that scotch takes different code paths internally + // if weights are not specified (issue #3063) + + if (numCells > 0) + { + velotab.resize(numCells); + } + else + { + // Locally zero cells but not globally. + // Provide some size to avoid null pointer. + velotab.resize(1); + } + + velotab = static_cast(1); + } // diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index e12252f806..c3637bd4dd 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -267,6 +267,15 @@ Foam::label Foam::scotchDecomp::decomposeSerial } } } + else + { + // HACK: specify uniform weights + // - seems that scotch takes different code paths internally + // if weights are not specified (issue #3063) + + velotab.resize(numCells); + velotab = static_cast(1); + } //