Commit c1c7b91d authored by Dave Moxey's avatar Dave Moxey

Fix for 2D/3D parallel periodic boundary conditions where at least one...

Fix for 2D/3D parallel periodic boundary conditions where at least one partition does not possess a periodic boundary.
parent cd5ff24f
......@@ -845,21 +845,27 @@ namespace Nektar
// Note if there are no periodic faces at all calling Vsum will
// cause a segfault.
if (perComps.size() > 0)
if (totEdges > 0)
{
nTotVerts = Vmath::Vsum(totEdges, edgeVerts, 1);
for (i = 0; i < n; ++i)
{
procVerts[i] = Vmath::Vsum(
edgecounts[i], edgeVerts + edgeoffset[i], 1);
}
}
else
{
nTotVerts = 0;
}
for (i = 0; i < n; ++i)
{
if (edgecounts[i] > 0)
{
procVerts[i] = Vmath::Vsum(
edgecounts[i], edgeVerts + edgeoffset[i], 1);
}
else
{
procVerts[i] = 0;
}
}
vertoffset[0] = 0;
for (i = 1; i < n; ++i)
......
......@@ -852,21 +852,29 @@ namespace Nektar
// Note if there are no periodic faces at all calling Vsum will
// cause a segfault.
if (perComps.size() > 0)
if (totFaces > 0)
{
// Calculate number of vertices on each processor.
nTotVerts = Vmath::Vsum(totFaces, faceVerts, 1);
for (i = 0; i < n; ++i)
{
procVerts[i] = Vmath::Vsum(
facecounts[i], faceVerts + faceoffset[i], 1);
}
}
else
{
nTotVerts = 0;
}
for (i = 0; i < n; ++i)
{
if (facecounts[i] > 0)
{
procVerts[i] = Vmath::Vsum(
facecounts[i], faceVerts + faceoffset[i], 1);
}
else
{
procVerts[i] = 0;
}
}
// vertoffset is defined in the same manner as edgeoffset
// beforehand.
vertoffset[0] = 0;
......
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