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

Fix iterative full solver

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