ENH: globalMeshData: allow call with empty transformed elements list

This commit is contained in:
mattijs
2012-03-15 15:43:09 +00:00
parent 66a64af359
commit 2ce9d80e90
2 changed files with 22 additions and 8 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -2403,7 +2403,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
(
masterGlobalPoint,
pointSlaves,
labelListList(cpp.nPoints()), // no transforms
labelListList(0), // no transforms
pointSlavesMap,
maxEqOp<label>()
);
@ -2684,7 +2684,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
(
globalMaster,
pointSlaves,
labelListList(cpp.nPoints()), // no transforms
labelListList(0), // no transforms
pointSlavesMap,
maxEqOp<label>()
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,10 +50,17 @@ void Foam::globalMeshData::syncData
Type& elem = elems[i];
const labelList& slavePoints = slaves[i];
const labelList& transformSlavePoints = transformedSlaves[i];
label nTransformSlavePoints =
(
transformedSlaves.size() == 0
? 0
: transformedSlaves[i].size()
);
if (slavePoints.size()+transformSlavePoints.size() > 0)
if (slavePoints.size()+nTransformSlavePoints > 0)
{
const labelList& transformSlavePoints = transformedSlaves[i];
// Combine master with untransformed slave data
forAll(slavePoints, j)
{
@ -109,10 +116,17 @@ void Foam::globalMeshData::syncData
Type& elem = elems[i];
const labelList& slavePoints = slaves[i];
const labelList& transformSlavePoints = transformedSlaves[i];
label nTransformSlavePoints =
(
transformedSlaves.size() == 0
? 0
: transformedSlaves[i].size()
);
if (slavePoints.size()+transformSlavePoints.size() > 0)
if (slavePoints.size()+nTransformSlavePoints > 0)
{
const labelList& transformSlavePoints = transformedSlaves[i];
// Combine master with untransformed slave data
forAll(slavePoints, j)
{