Commit e693f21d authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: use ListOps::appendEqOp instead of local version

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

- introduced by vector::zero -> Zero replacement (commit 683cfb9d)
parent 44e38608
......@@ -1940,7 +1940,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
(
Pstream::commsTypes::blocking,
slave,
sharedPoints.size()*sizeof(Zero)
sharedPoints.size()*sizeof(Foam::vector) // byteSize()
);
toSlave << sharedPoints;
}
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2015 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -914,7 +914,7 @@ handleFeatureAngleLayerTerminations
mesh(),
meshEdges,
edgeFaceNormals,
globalMeshData::ListPlusEqOp<List<point>>(), // combine operator
ListOps::appendEqOp<point>(),
List<point>() // null value
);
......@@ -923,7 +923,7 @@ handleFeatureAngleLayerTerminations
mesh(),
meshEdges,
edgeFaceExtrude,
globalMeshData::ListPlusEqOp<List<bool>>(), // combine operator
ListOps::appendEqOp<bool>(),
List<bool>() // null value
);
......
......@@ -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()
);
......
......@@ -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>
......
Markdown is supported
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