ENH: globalMeshData: expose plusEq operator for Lists.

This commit is contained in:
mattijs
2013-10-14 14:51:20 +01:00
parent 8f2e21952b
commit 719885002c
2 changed files with 24 additions and 24 deletions

View File

@ -1963,7 +1963,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const
pointField sharedPoints(mesh_.points(), sharedPointLabels());
// Append from all processors
combineReduce(sharedPoints, plusEqOp<pointField>());
combineReduce(sharedPoints, ListPlusEqOp<pointField>());
// Merge tolerance
scalar tolDim = matchTol_ * mesh_.bounds().mag();

View File

@ -109,29 +109,6 @@ class globalMeshData
public processorTopology
{
// Private class
// To combineReduce a pointField. Just appends all lists.
template<class T>
class plusEqOp
{
public:
void operator()(T& x, const T& y) const
{
label n = x.size();
x.setSize(x.size() + y.size());
forAll(y, i)
{
x[n++] = y[i];
}
}
};
// Private data
//- Reference to mesh
@ -337,6 +314,29 @@ class globalMeshData
public:
// Public class
// To combineReduce a List. Just appends all lists.
template<class T>
class ListPlusEqOp
{
public:
void operator()(T& x, const T& y) const
{
label n = x.size();
x.setSize(x.size() + y.size());
forAll(y, i)
{
x[n++] = y[i];
}
}
};
//- Runtime type information
ClassName("globalMeshData");