BUG: refinementHistory: access outside range

This commit is contained in:
mattijs
2014-03-20 16:50:42 +00:00
committed by Andrew Heather
parent 8e76c66558
commit 01813d0339

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -648,23 +648,21 @@ void Foam::refinementHistory::countProc
// Increment parent if whole splitCell moves to same processor // Increment parent if whole splitCell moves to same processor
if (splitCellNum[index] == 8) if (splitCellNum[index] == 8)
{
if (debug)
{ {
Pout<< "Moving " << splitCellNum[index] Pout<< "Moving " << splitCellNum[index]
<< " cells originating from cell " << index << " cells originating from cell " << index
<< " from processor " << Pstream::myProcNo() << " from processor " << Pstream::myProcNo()
<< " to processor " << splitCellProc[index] << " to processor " << splitCellProc[index]
<< endl; << endl;
}
label parent = splitCells_[index].parent_; label parent = splitCells_[index].parent_;
if (parent >= 0) if (parent >= 0)
{ {
string oldPrefix = Pout.prefix();
Pout.prefix() = " " + oldPrefix;
countProc(parent, newProcNo, splitCellProc, splitCellNum); countProc(parent, newProcNo, splitCellProc, splitCellNum);
Pout.prefix() = oldPrefix;
} }
} }
} }
@ -923,10 +921,13 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
const labelList& constructMap = map.cellMap().constructMap()[procI]; const labelList& constructMap = map.cellMap().constructMap()[procI];
forAll(newVisibleCells, i) forAll(newVisibleCells, i)
{
if (newVisibleCells[i] >= 0)
{ {
visibleCells_[constructMap[i]] = newVisibleCells[i] + offset; visibleCells_[constructMap[i]] = newVisibleCells[i] + offset;
} }
} }
}
splitCells_.shrink(); splitCells_.shrink();
//Pout<< nl << "--AFTER:" << endl; //Pout<< nl << "--AFTER:" << endl;