mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated mappedPatchBase to include binary op functions for distribute
This commit is contained in:
@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user