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,61 +584,84 @@ 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];
|
||||||
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
|
||||||
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
|
|
||||||
label connI = 0;
|
|
||||||
|
|
||||||
// Add myself
|
if (pSlaves.size()+pTransformSlaves.size())
|
||||||
pConnectivity[connI++] = myData[pointI];
|
|
||||||
// Add untransformed points
|
|
||||||
forAll(pSlaves, i)
|
|
||||||
{
|
{
|
||||||
pConnectivity[connI++] = myData[pSlaves[i]];
|
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
||||||
}
|
|
||||||
// Add transformed points.
|
|
||||||
forAll(pTransformSlaves, i)
|
|
||||||
{
|
|
||||||
// Get transform from index
|
|
||||||
label transformI = globalPointSlavesMap().whichTransform
|
|
||||||
(
|
|
||||||
pTransformSlaves[i]
|
|
||||||
);
|
|
||||||
// Add transform to connectivity
|
|
||||||
const labelPair& n = myData[pTransformSlaves[i]];
|
|
||||||
label proci = globalIndexAndTransform::processor(n);
|
|
||||||
label index = globalIndexAndTransform::index(n);
|
|
||||||
pConnectivity[connI++] = globalIndexAndTransform::encode
|
|
||||||
(
|
|
||||||
proci,
|
|
||||||
index,
|
|
||||||
transformI
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Put back in slots
|
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
|
||||||
forAll(pSlaves, i)
|
label connI = 0;
|
||||||
{
|
|
||||||
allPointConnectivity[pSlaves[i]] = pConnectivity;
|
// Add myself
|
||||||
}
|
pConnectivity[connI++] = myData[pointI];
|
||||||
forAll(pTransformSlaves, i)
|
// Add untransformed points
|
||||||
{
|
forAll(pSlaves, i)
|
||||||
allPointConnectivity[pTransformSlaves[i]] = pConnectivity;
|
{
|
||||||
|
pConnectivity[connI++] = myData[pSlaves[i]];
|
||||||
|
}
|
||||||
|
// Add transformed points.
|
||||||
|
forAll(pTransformSlaves, i)
|
||||||
|
{
|
||||||
|
// Get transform from index
|
||||||
|
label transformI = globalPointSlavesMap().whichTransform
|
||||||
|
(
|
||||||
|
pTransformSlaves[i]
|
||||||
|
);
|
||||||
|
// Add transform to connectivity
|
||||||
|
const labelPair& n = myData[pTransformSlaves[i]];
|
||||||
|
label proci = globalIndexAndTransform::processor(n);
|
||||||
|
label index = globalIndexAndTransform::index(n);
|
||||||
|
pConnectivity[connI++] = globalIndexAndTransform::encode
|
||||||
|
(
|
||||||
|
proci,
|
||||||
|
index,
|
||||||
|
transformI
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Put back in slots
|
||||||
|
forAll(pSlaves, i)
|
||||||
|
{
|
||||||
|
allPointConnectivity[pSlaves[i]] = pConnectivity;
|
||||||
|
}
|
||||||
|
forAll(pTransformSlaves, i)
|
||||||
|
{
|
||||||
|
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