mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: globalMeshData: expose plusEq operator for Lists.
This commit is contained in:
@ -1963,7 +1963,7 @@ Foam::pointField Foam::globalMeshData::geometricSharedPoints() const
|
|||||||
pointField sharedPoints(mesh_.points(), sharedPointLabels());
|
pointField sharedPoints(mesh_.points(), sharedPointLabels());
|
||||||
|
|
||||||
// Append from all processors
|
// Append from all processors
|
||||||
combineReduce(sharedPoints, plusEqOp<pointField>());
|
combineReduce(sharedPoints, ListPlusEqOp<pointField>());
|
||||||
|
|
||||||
// Merge tolerance
|
// Merge tolerance
|
||||||
scalar tolDim = matchTol_ * mesh_.bounds().mag();
|
scalar tolDim = matchTol_ * mesh_.bounds().mag();
|
||||||
|
|||||||
@ -109,29 +109,6 @@ class globalMeshData
|
|||||||
public processorTopology
|
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
|
// Private data
|
||||||
|
|
||||||
//- Reference to mesh
|
//- Reference to mesh
|
||||||
@ -337,6 +314,29 @@ class globalMeshData
|
|||||||
|
|
||||||
public:
|
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
|
//- Runtime type information
|
||||||
ClassName("globalMeshData");
|
ClassName("globalMeshData");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user