mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Added clearing out existing map; added reverse distribution
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user