Commit 8ebd0628 authored by David Moxey's avatar David Moxey
Browse files

Fix iterative full solver

parent ee792bf9
......@@ -131,7 +131,7 @@ namespace Nektar
expList->GetComm()->AllReduce(nDirTotal, LibUtilities::ReduceSum);
Array<OneD, NekDouble> tmp(nGlobDofs);
Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
if(nDirTotal)
{
......@@ -156,9 +156,12 @@ namespace Nektar
if (vCG)
{
Array<OneD, NekDouble> out(nGlobDofs,0.0);
// solve for perturbation from intiial guess in pOutput
SolveLinearSystem(nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
Vmath::Vadd(nGlobDofs,out,1,pOutput,1,out,1);
SolveLinearSystem(
nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
&pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
}
else
{
......
......@@ -146,12 +146,11 @@ namespace Nektar
int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
int check = nDirDofs > 0 ? 1 : 0;
LibUtilities::CommSharedPtr vComm
= m_expList.lock()->GetSession()->GetComm();
vComm->AllReduce(check, LibUtilities::ReduceMax);
int nDirTotal = nDirDofs;
m_expList.lock()->GetComm()->GetRowComm()->AllReduce(
nDirTotal, LibUtilities::ReduceSum);
if(check)
if(nDirTotal)
{
// calculate the dirichlet forcing
if(dirForcCalculated)
......
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