streamlines: Protected operation agaist no streamlines being generated

This commit is contained in:
Will Bainbridge
2023-02-16 11:12:06 +00:00
parent 9410d84a7e
commit c8f177e453

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -368,7 +368,7 @@ bool Foam::functionObjects::streamlines::write()
// Bin-sort by track and trackPart to build an ordering
labelList order(allPositions.size());
if (Pstream::master())
if (Pstream::master() && allPositions.size())
{
const label nTracks = max(allTracks) + 1;
const label trackParti0 = min(allTrackParts);