STYLE: use ListOps::appendEqOp instead of local version

BUG: bad buffer size in globalMeshData::sharedPoints()

- introduced by vector::zero -> Zero replacement (commit 683cfb9d97)
This commit is contained in:
Mark Olesen
2020-02-05 09:56:14 +01:00
parent 44e3860888
commit e693f21d69
4 changed files with 9 additions and 41 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -543,7 +543,7 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
globalSrcCells.inplaceToGlobal(addressing);
}
// set up as a reverse distribute
// Set up as a reverse distribute
mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
@ -554,12 +554,12 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
map.subMap(),
false,
tgtToSrcCellAddr_,
ListPlusEqOp<label>(),
ListOps::appendEqOp<label>(),
flipOp(),
labelList()
);
// set up as a reverse distribute
// Set up as a reverse distribute
mapDistributeBase::distribute
(
Pstream::commsTypes::nonBlocking,
@ -570,7 +570,7 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
map.subMap(),
false,
tgtToSrcCellWght_,
ListPlusEqOp<scalar>(),
ListOps::appendEqOp<scalar>(),
flipOp(),
scalarList()
);

View File

@ -33,38 +33,6 @@ License
#include "fvcGrad.H"
#include "distributedWeightedFvPatchFieldMapper.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
//- Helper class for list
template<class Type>
class ListPlusEqOp
{
public:
void operator()(List<Type>& x, const List<Type> y) const
{
if (y.size())
{
if (x.size())
{
label sz = x.size();
x.setSize(sz + y.size());
forAll(y, i)
{
x[sz++] = y[i];
}
}
else
{
x = y;
}
}
}
};
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>