Commit 56f2c469 authored by David Moxey's avatar David Moxey
Browse files

Fix direct/PETSc full solvers

parent fd5fa274
......@@ -137,8 +137,10 @@ namespace Nektar
tmp.get(), 1);
}
SolveLinearSystem(nGlobDofs, tmp, pOutput,
pLocToGloMap, nDirDofs);
Array<OneD, NekDouble> out(nGlobDofs,0.0);
SolveLinearSystem(nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
&pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
}
else
{
......
......@@ -88,6 +88,7 @@ namespace Nektar
// Grab number of iterations taken
PetscInt its;
KSPGetIterationNumber(m_ksp, &its);
cout << "iterations = " << its << endl;
// Scatter results to local vector
VecScatterBegin(m_ctx, m_x, m_locVec, INSERT_VALUES, SCATTER_FORWARD);
......
......@@ -71,7 +71,7 @@ namespace Nektar
const int nDofs = pLocToGloMap->GetNumGlobalCoeffs();
const int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
int i, j, n, cnt, gid1, gid2, loc_lda;
NekDouble sign1, sign2, value;
DNekScalMatSharedPtr loc_mat;
......@@ -174,8 +174,10 @@ namespace Nektar
tmp.get(), 1);
}
SolveLinearSystem(nGlobDofs, tmp, pOutput,
pLocToGloMap, nDirDofs);
Array<OneD, NekDouble> out(nGlobDofs,0.0);
SolveLinearSystem(nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
&pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
}
else
{
......
......@@ -146,20 +146,7 @@ namespace Nektar
NekVector<NekDouble> V_GlobHomBndTmp(nGlobHomBndDofs,0.0);
// set up normalisation factor for right hand side on first SC level
#if 0
if(scLevel == 0)
{
Set_Rhs_Magnitude(F_GlobBnd);
}
// Select correct matrix to use at difference levels: top level
// should use the transformed matrix, all other levels should use
// original matrix since the transformed matrix is recursively
// passed down.
DNekScalBlkMatSharedPtr sc = scLevel == 0 ? m_S1Blk : m_schurCompl;
#else
DNekScalBlkMatSharedPtr sc = v_PreSolve(scLevel, F_GlobBnd);
#endif
if(nGlobHomBndDofs)
{
......
......@@ -136,7 +136,7 @@ namespace Nektar
StdRegions::ePreconLinearSpaceMass :
StdRegions::ePreconLinearSpace;
GlobalLinSysKey preconKey(mType, m_vertLocToGloMap);
GlobalLinSysKey preconKey(mType, m_vertLocToGloMap, (m_linsys.lock())->GetKey().GetConstFactors());
switch(solveType)
{
......
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