mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: processorLOD: handle 0 cells. Fixes #2421
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -148,7 +148,7 @@ void Foam::processorLODs::box::setRefineFlags
|
||||
labelList& procRefineFlags = refineFlags[proci];
|
||||
procRefineFlags.setSize(remoteSrcBoxes.size(), FIXED);
|
||||
|
||||
if (scalar(nTgtObjects)/scalar(nObjects) < 0.1)
|
||||
if (nObjects == 0 || scalar(nTgtObjects)/scalar(nObjects) < 0.1)
|
||||
{
|
||||
// Sending less than 10% of objects of this type
|
||||
// - shortcut by sending all
|
||||
|
||||
@ -124,7 +124,9 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
// (possibly remote) cells from the tgt mesh such that they
|
||||
// (together) cover all of the src mesh
|
||||
const label nGlobalSrcCells = src.globalData().nTotalCells();
|
||||
const label cellsPerBox = max(1, 0.001*nGlobalSrcCells);
|
||||
// Note: minimum content has to be > 1 since otherwise
|
||||
// would keep on splitting. 16 is fairly random choice.
|
||||
const label cellsPerBox = max(16, 0.001*nGlobalSrcCells);
|
||||
typename processorLODs::cellBox boxLOD
|
||||
(
|
||||
src.cells(),
|
||||
|
||||
Reference in New Issue
Block a user