Commit 923764e3 authored by mattijs's avatar mattijs
Browse files

in-place subset bug

parent 42c075d8
......@@ -58,7 +58,13 @@ void Foam::mapDistribute::distribute
}
// Subset myself
UIndirectList<T> subField(field, subMap[Pstream::myProcNo()]);
const labelList& mySubMap = subMap[Pstream::myProcNo()];
List<T> subField(mySubMap.size());
forAll(mySubMap, i)
{
subField[i] = field[mySubMap[i]];
}
// Receive sub field from myself (subField)
const labelList& map = constructMap[Pstream::myProcNo()];
......@@ -355,7 +361,13 @@ void Foam::mapDistribute::distribute
}
// Subset myself
UIndirectList<T> subField(field, subMap[Pstream::myProcNo()]);
const labelList& mySubMap = subMap[Pstream::myProcNo()];
List<T> subField(mySubMap.size());
forAll(mySubMap, i)
{
subField[i] = field[mySubMap[i]];
}
// Receive sub field from myself (subField)
const labelList& map = constructMap[Pstream::myProcNo()];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment