Commit 73781ad6 authored by mattijs's avatar mattijs
Browse files

Added clearing out existing map; added reverse distribution

parent 48b98e4d
......@@ -288,6 +288,7 @@ Foam::mapDistribute::mapDistribute
forAll(compactMap, procI)
{
compactMap[procI].clear();
if (procI != Pstream::myProcNo())
{
compactMap[procI].resize(2*nNonLocal[procI]);
......@@ -433,6 +434,7 @@ Foam::mapDistribute::mapDistribute
forAll(compactMap, procI)
{
compactMap[procI].clear();
if (procI != Pstream::myProcNo())
{
compactMap[procI].resize(2*nNonLocal[procI]);
......
......@@ -276,6 +276,49 @@ public:
}
}
//- Reverse distribute data using default commsType.
template<class T>
void reverseDistribute(const label constructSize, List<T>& fld)
const
{
if (Pstream::defaultCommsType == Pstream::nonBlocking)
{
distribute
(
Pstream::nonBlocking,
List<labelPair>(),
constructSize,
constructMap_,
subMap_,
fld
);
}
else if (Pstream::defaultCommsType == Pstream::scheduled)
{
distribute
(
Pstream::scheduled,
schedule(),
constructSize,
constructMap_,
subMap_,
fld
);
}
else
{
distribute
(
Pstream::blocking,
List<labelPair>(),
constructSize,
constructMap_,
subMap_,
fld
);
}
}
//- Correct for topo change.
void updateMesh(const mapPolyMesh&)
{
......
......@@ -552,7 +552,6 @@ void Foam::mapDistribute::distribute
{
if (!contiguous<T>())
{
//XXXXXX
PstreamBuffers pBuffs(Pstream::nonBlocking);
// Stream data into buffer
......
Markdown is supported
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