Added clearing out existing map; added reverse distribution

This commit is contained in:
mattijs
2010-01-01 11:14:21 +00:00
parent 48b98e4dc7
commit 73781ad682
3 changed files with 45 additions and 1 deletions

View File

@ -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]);

View File

@ -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&)
{

View File

@ -552,7 +552,6 @@ void Foam::mapDistribute::distribute
{
if (!contiguous<T>())
{
//XXXXXX
PstreamBuffers pBuffs(Pstream::nonBlocking);
// Stream data into buffer