Commit 0c972161 authored by Chris Cantwell's avatar Chris Cantwell

Fixed boundary condition application for XXT solver.

parent 977390aa
......@@ -19,7 +19,8 @@ IF( NEKTAR_USE_MPI )
URL_MD5 "f2c1f7695f361c6d87365e2ea63aece1"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND
${CMAKE_COMMAND}
${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist
${TPSRC}/src/gsmpi-1.1
)
......
......@@ -1333,7 +1333,8 @@ namespace Nektar
{
ASSERTL0 (m_solverInfo["GLOBALSYSSOLN"] == "IterativeFull"
|| m_solverInfo["GLOBALSYSSOLN"] == "IterativeStaticCond",
"An iterative solver must be used when run in parallel.");
|| m_solverInfo["GLOBALSYSSOLN"] == "XxtFull".
"An parallel solver must be used when run in parallel.");
}
if (m_verbose && m_solverInfo.size() > 0 && m_comm)
......
......@@ -151,7 +151,7 @@ namespace Gs
LibUtilities::CommMpiSharedPtr vCommMpi = boost::dynamic_pointer_cast<LibUtilities::CommMpi> (pComm);
ASSERTL1(vCommMpi, "Failed to cast MPI Comm object.");
comm vComm;
vComm.c = vCommMpi->GetComm();
MPI_Comm_dup(vCommMpi->GetComm(), &vComm.c);
vComm.id = vCommMpi->GetRank();
vComm.np = vCommMpi->GetSize();
return nektar_gs_setup(&pId[0], pId.num_elements(), &vComm);
......
......@@ -164,7 +164,7 @@ namespace Xxt
LibUtilities::CommMpiSharedPtr vCommMpi = boost::dynamic_pointer_cast<LibUtilities::CommMpi> (pComm);
ASSERTL1(vCommMpi, "Failed to cast MPI Comm object.");
comm vComm;
vComm.c = vCommMpi->GetComm();
MPI_Comm_dup(vCommMpi->GetComm(), &vComm.c);
vComm.id = vCommMpi->GetRank();
vComm.np = vCommMpi->GetSize();
return nektar_crs_setup(pRank, &pId[0], nz, &pAi[0], &pAj[0], &pAr[0], 0, &vComm);
......
......@@ -74,7 +74,19 @@ namespace Nektar
Array<OneD, NekDouble> vLocalOut(nLocal, 0.0);
Array<OneD, NekDouble> vTmpLocal(pLocToGloMap->GetNumLocalCoeffs());
GlobalToLocalNoSign(pInput, vLocalIn, pLocToGloMap);
//pLocToGloMap->GlobalToLocal(pInput, vLocalIn);
Xxt::Solve(vLocalOut, m_crsData, vLocalIn);
// cout << "Local" << endl;
// for (int i = 0; i < nLocal; ++i)
// {
// cout << i << ": " << vLocalOut[i] << endl;
// }
//pLocToGloMap->Assemble(vLocalOut, pOutput);
// cout << "Global" << endl;
// for (int i = 0; i < pLocToGloMap->GetNumGlobalCoeffs(); ++i)
// {
// cout << i << ": " << pOutput[i] << endl;
// }
LocalToGlobalNoSign(vLocalOut, pOutput, pLocToGloMap);
}
......
......@@ -96,6 +96,7 @@ namespace Nektar
// calculate the dirichlet forcing
int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
Array<OneD, NekDouble> tmp(nGlobDofs);
Array<OneD, NekDouble> tmp2(nGlobDofs);
if(dirForcCalculated)
{
Vmath::Vsub(nGlobDofs, pInput.get(), 1,
......@@ -117,7 +118,10 @@ namespace Nektar
tmp.get(), 1);
}
SolveLinearSystem(nGlobDofs, tmp, pOutput, pLocToGloMap);
SolveLinearSystem(nGlobDofs, tmp, tmp2, pLocToGloMap);
// Put back the Dirichlet boundary conditions
Vmath::Vadd(nGlobDofs, pOutput.get(), 1, tmp2.get(), 1, pOutput.get(), 1);
}
else
{
......@@ -197,6 +201,7 @@ namespace Nektar
m_Ai[k] = iCount + i;
m_Aj[k] = iCount + j;
m_Ar[k] = (*loc_mat)(i,j);
//m_Ar[k] /= m_locToGloSignMult[cnt+i]*m_locToGloSignMult[cnt+j];
if (doSign)
{
m_Ar[k] *= vMapSign[cnt+i]*vMapSign[cnt+j];
......@@ -205,7 +210,10 @@ namespace Nektar
if (gid1 < numDirBnd)
vId[iCount + i] = 0;
else
{
//vId[iCount + i] = pLocToGloMap->GetGlobalToUniversalMap(gid1);
vId[iCount + i] = gid1;
}
}
cnt += nRows;
iCount += vSizes[n];
......@@ -214,6 +222,7 @@ namespace Nektar
LibUtilities::CommSharedPtr vComm = pLocToGloMap->GetComm();
m_crsData = Xxt::Init(nLocal, vId, m_Ai, m_Aj, m_Ar, vComm);
Xxt::nektar_crs_stats(m_crsData);
}
}
}
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