Skip to content

suspicious code in writeFields.C

around Line 615:

    forAll(fc, i)
    {
        const label meshFacei = fvp.patch().start();
        cellFld[fc[i]] = min(cellFld[fc[i]], ownPyrVol[meshFacei]);
    }

Looks like it should be meshFacei = fvp.patch().start() + i` was forgotten. Or instead:

    label meshFacei = fvp.patch().start();

    for (const label celli : fc)
    {
        cellFld[celli] = Foam::min(cellFld[celli], ownPyrVol[meshFacei]);
        ++meshFacei;
    }

seen while looking at #3348

Edited by Mark OLESEN