mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
@ -584,18 +584,26 @@ void Foam::globalMeshData::calcPointConnectivity
|
|||||||
transforms.nullTransformIndex()
|
transforms.nullTransformIndex()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Send over.
|
// Send to master
|
||||||
globalPointSlavesMap().distribute(myData);
|
globalPointSlavesMap().distribute(myData);
|
||||||
|
|
||||||
|
|
||||||
// String of connected points with their transform
|
// String of connected points with their transform
|
||||||
allPointConnectivity.setSize(globalPointSlavesMap().constructSize());
|
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)
|
forAll(slaves, pointI)
|
||||||
{
|
{
|
||||||
// Reconstruct string of connected points
|
// Reconstruct string of connected points
|
||||||
const labelList& pSlaves = slaves[pointI];
|
const labelList& pSlaves = slaves[pointI];
|
||||||
const labelList& pTransformSlaves = transformedSlaves[pointI];
|
const labelList& pTransformSlaves = transformedSlaves[pointI];
|
||||||
|
|
||||||
|
if (pSlaves.size()+pTransformSlaves.size())
|
||||||
|
{
|
||||||
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
||||||
|
|
||||||
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
|
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
|
||||||
label connI = 0;
|
label connI = 0;
|
||||||
|
|
||||||
@ -636,9 +644,24 @@ void Foam::globalMeshData::calcPointConnectivity
|
|||||||
allPointConnectivity[pTransformSlaves[i]] = pConnectivity;
|
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
|
globalPointSlavesMap().reverseDistribute
|
||||||
(
|
(
|
||||||
allPointConnectivity.size(),
|
slaves.size(),
|
||||||
allPointConnectivity
|
allPointConnectivity
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -792,13 +815,13 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
|||||||
// Push back
|
// Push back
|
||||||
globalPointSlavesMap().reverseDistribute
|
globalPointSlavesMap().reverseDistribute
|
||||||
(
|
(
|
||||||
globalPointEdges.size(),
|
slaves.size(),
|
||||||
globalPointEdges
|
globalPointEdges
|
||||||
);
|
);
|
||||||
// Push back
|
// Push back
|
||||||
globalPointSlavesMap().reverseDistribute
|
globalPointSlavesMap().reverseDistribute
|
||||||
(
|
(
|
||||||
globalPointPoints.size(),
|
slaves.size(),
|
||||||
globalPointPoints
|
globalPointPoints
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -880,7 +903,7 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
|
|||||||
|
|
||||||
|
|
||||||
// 1. collect point connectivity - basically recreating globalPoints output.
|
// 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.
|
// in respect to the master.
|
||||||
List<labelPairList> allPointConnectivity;
|
List<labelPairList> allPointConnectivity;
|
||||||
calcPointConnectivity(allPointConnectivity);
|
calcPointConnectivity(allPointConnectivity);
|
||||||
|
|||||||
Reference in New Issue
Block a user