Commit aa175afd authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge branch 'fix/MultiLevel-periodic' into 'master'

Fix MultiLevelStaticCond with periodic BCs

This should fix issue #21, regarding the use of MultiLevelStaticCond with periodic boundary conditions in parallel. Basically, this involves forcing all periodic boundary conditions to be on the last level of the static cond. I expected doing this only for the dofs connected to other partitions would be enough, but apparently it is not since it leads to a segfault in one of the cases I tested.

See merge request !614
parents 333366c8 4a0df219
......@@ -13,6 +13,8 @@ v4.3.1
- Fix bug in modified Arnoldi algorithm causing convergence to be reported when
number of vectors is less than `nvec` (!608)
- Fix uninitialised array bug in AssemblyMap (!598)
- Fix use of multi-level static condensation in parallel with periodic
boundary conditions (!614)
**NekMesh**:
- Fix incorrect link directory on CCMIO library.
......
......@@ -504,7 +504,7 @@ namespace Nektar
{
if (pIt->second[i].isLocal)
{
graph[0][pIt->second[i].id] = gId;
graph[0][pIt->second[i].id] = graph[0][meshVertId];
}
}
}
......@@ -528,7 +528,7 @@ namespace Nektar
{
if (pIt->second[i].isLocal)
{
graph[0][pIt->second[i].id] = gId;
graph[0][pIt->second[i].id] = graph[0][pIt->first];
}
}
}
......@@ -692,6 +692,7 @@ namespace Nektar
if (i == pIt->second.size())
{
boost::add_vertex(boostGraphObj);
tempGraph[0][meshVertId] = tempGraphVertId++;
m_numNonDirVertexModes++;
}
......@@ -807,6 +808,7 @@ namespace Nektar
if (i == pIt->second.size())
{
boost::add_vertex(boostGraphObj);
tempGraph[1][meshEdgeId] = tempGraphVertId++;
m_numNonDirEdgeModes += EdgeSize[meshEdgeId];
m_numNonDirEdges++;
......@@ -857,6 +859,7 @@ namespace Nektar
meshFaceId = pIt->first;
ASSERTL0(graph[2].count(meshFaceId) == 0,
"This periodic boundary edge has been specified before");
boost::add_vertex(boostGraphObj);
tempGraph[2][meshFaceId] = tempGraphVertId++;
nFaceIntCoeffs = FaceSize[meshFaceId];
m_numNonDirFaceModes+=nFaceIntCoeffs;
......@@ -869,6 +872,7 @@ namespace Nektar
ASSERTL0(graph[2].count(pIt->second[0].id) == 0,
"This periodic boundary face has been specified before");
boost::add_vertex(boostGraphObj);
tempGraph[2][pIt->first] = tempGraphVertId;
tempGraph[2][pIt->second[0].id] = tempGraphVertId++;
nFaceIntCoeffs = FaceSize[pIt->first];
......@@ -1052,7 +1056,7 @@ namespace Nektar
}
// Container to store vertices of the graph which correspond to
// degrees of freedom along the boundary.
// degrees of freedom along the boundary and periodic BCs.
set<int> partVerts;
if (m_solnType == eIterativeMultiLevelStaticCond ||
......@@ -1167,6 +1171,29 @@ namespace Nektar
}
}
}
// Now fill with all vertices on periodic BCs
for (pIt = periodicVerts.begin(); pIt != periodicVerts.end(); ++pIt)
{
if (graph[0].count(pIt->first) == 0)
{
partVerts.insert(tempGraph[0][pIt->first]);
}
}
for (pIt = periodicEdges.begin(); pIt != periodicEdges.end(); ++pIt)
{
if (graph[1].count(pIt->first) == 0)
{
partVerts.insert(tempGraph[1][pIt->first]);
}
}
for (pIt = periodicFaces.begin(); pIt != periodicFaces.end(); ++pIt)
{
if (graph[2].count(pIt->first) == 0)
{
partVerts.insert(tempGraph[2][pIt->first]);
}
}
}
int nGraphVerts = tempGraphVertId;
......
......@@ -119,6 +119,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES )
ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8_par)
ADD_NEKTAR_TEST_LENGTHY(Pyr_channel_m6_par)
ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8_srhs_par)
ADD_NEKTAR_TEST(Tet_channel_m4_per_xxt_ml_par)
ADD_NEKTAR_TEST(Tet_channel_m8_par)
ADD_NEKTAR_TEST_LENGTHY(Tet_channel_m8_iter_ml_par)
ADD_NEKTAR_TEST_LENGTHY(bfs_tg_par)
......
......@@ -2,7 +2,7 @@
<test>
<description>3D channel flow, Tetrahedral elements, P=4, periodic BCs</description>
<executable>IncNavierStokesSolver</executable>
<parameters>Tet_channel_m4_per.xml</parameters>
<parameters>-I GlobalSysSoln=DirectStaticCond Tet_channel_m4_per.xml</parameters>
<files>
<file description="Session File">Tet_channel_m4_per.xml</file>
</files>
......
......@@ -84,7 +84,6 @@
<I PROPERTY="AdvectionForm" VALUE="Convective" />
<I PROPERTY="Projection" VALUE="Galerkin" />
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder1" />
<I PROPERTY="GlobalSysSoln" VALUE="DirectStaticCond" />
</SOLVERINFO>
<PARAMETERS>
......
<?xml version="1.0" encoding="utf-8" ?>
<test>
<description>3D channel flow, Tetrahedral elements, P=4, periodic BCs, XxtMultiLevelStaticCond, par(2)</description>
<executable>IncNavierStokesSolver</executable>
<parameters>--use-metis -I GlobalSysSoln=XxtMultiLevelStaticCond Tet_channel_m4_per.xml</parameters>
<processes>2</processes>
<files>
<file description="Session File">Tet_channel_m4_per.xml</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-12">0</value>
<value variable="v" tolerance="1e-12">0</value>
<value variable="w" tolerance="1e-12">0</value>
<value variable="p" tolerance="1e-12">0</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-12">0</value>
<value variable="v" tolerance="1e-12">0</value>
<value variable="w" tolerance="1e-12">0</value>
<value variable="p" tolerance="1e-12">0</value>
</metric>
</metrics>
</test>
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