Commit f7f1eea3 authored by Henry Weller's avatar Henry Weller
Browse files

globalMeshData: Handle cyclic baffles in coupled edge synchronisation

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2080
Patch contributed by Mattijs Janssens
parent 055b41e4
......@@ -584,18 +584,26 @@ void Foam::globalMeshData::calcPointConnectivity
transforms.nullTransformIndex()
);
}
// Send over.
// Send to master
globalPointSlavesMap().distribute(myData);
// String of connected points with their transform
allPointConnectivity.setSize(globalPointSlavesMap().constructSize());
allPointConnectivity = labelPairList(0);
// Pass1: do the master points since these also update local slaves
// (e.g. from local cyclics)
forAll(slaves, pointI)
{
// Reconstruct string of connected points
const labelList& pSlaves = slaves[pointI];
const labelList& pTransformSlaves = transformedSlaves[pointI];
if (pSlaves.size()+pTransformSlaves.size())
{
labelPairList& pConnectivity = allPointConnectivity[pointI];
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
label connI = 0;
......@@ -636,9 +644,24 @@ void Foam::globalMeshData::calcPointConnectivity
allPointConnectivity[pTransformSlaves[i]] = pConnectivity;
}
}
}
// Pass2: see if anything is still unset (should not be the case)
forAll(slaves, pointI)
{
labelPairList& pConnectivity = allPointConnectivity[pointI];
if (pConnectivity.size() == 0)
{
pConnectivity.setSize(1, myData[pointI]);
}
}
globalPointSlavesMap().reverseDistribute
(
allPointConnectivity.size(),
slaves.size(),
allPointConnectivity
);
}
......@@ -792,13 +815,13 @@ void Foam::globalMeshData::calcGlobalPointEdges
// Push back
globalPointSlavesMap().reverseDistribute
(
globalPointEdges.size(),
slaves.size(),
globalPointEdges
);
// Push back
globalPointSlavesMap().reverseDistribute
(
globalPointPoints.size(),
slaves.size(),
globalPointPoints
);
}
......@@ -880,7 +903,7 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
// 1. collect point connectivity - basically recreating globalPoints output.
// All points will now have a string of points. The transforms are
// All points will now have a string of coupled points. The transforms are
// in respect to the master.
List<labelPairList> allPointConnectivity;
calcPointConnectivity(allPointConnectivity);
......
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