Skip to content
Snippets Groups Projects
Commit 24b949f5 authored by andy's avatar andy
Browse files

ENH: Updated mappedPatchBase to include binary op functions for distribute

parent c11de238
Branches
Tags
No related merge requests found
......@@ -339,6 +339,39 @@ public:
}
//- Wrapper around map/interpolate data distribution with supplied op
template<class Type, class BinaryOp>
void distribute(List<Type>& lst, const BinaryOp& bop) const
{
switch (mode_)
{
case NEARESTPATCHFACEAMI:
{
lst = AMI().interpolateToSource
(
Field<Type>(lst.xfer()),
bop
);
break;
}
default:
{
map().distribute
(
Pstream::defaultCommsType,
map().schedule(),
map().constructSize(),
map().subMap(),
map().constructMap(),
lst,
bop,
pTraits<Type>::zero
);
}
}
}
//- Wrapper around map/interpolate data distribution
template<class Type>
void reverseDistribute(List<Type>& lst) const
......@@ -359,6 +392,40 @@ public:
}
//- Wrapper around map/interpolate data distribution with supplied op
template<class Type, class BinaryOp>
void reverseDistribute(List<Type>& lst, const BinaryOp& bop) const
{
switch (mode_)
{
case NEARESTPATCHFACEAMI:
{
lst = AMI().interpolateToTarget
(
Field<Type>(lst.xfer()),
bop
);
break;
}
default:
{
label cSize = patch_.size();
map().distribute
(
Pstream::defaultCommsType,
map().schedule(),
cSize,
map().constructMap(),
map().subMap(),
lst,
bop,
pTraits<Type>::zero
);
}
}
}
//- Return reference to the parallel distribution map
const mapDistribute& map() const
{
......
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