Commit b5068a8f authored by Dave Moxey's avatar Dave Moxey

Fixing full solvers, adding Dirichlet boundary fix to XxtStaticCond.

parent 4be22850
......@@ -111,12 +111,12 @@ namespace Nektar
{
bool dirForcCalculated = (bool) pDirForcing.num_elements();
int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
if(nDirDofs)
{
// calculate the dirichlet forcing
int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
Array<OneD, NekDouble> tmp(nGlobDofs);
if(dirForcCalculated)
{
Vmath::Vsub(nGlobDofs, pInput.get(), 1,
......@@ -130,23 +130,25 @@ namespace Nektar
int nLocDofs = pLocToGloMap->GetNumLocalCoeffs();
m_expList.lock()->GeneralMatrixOp(
m_linSysKey,
pOutput, tmp, eGlobal);
m_linSysKey, pOutput, tmp, eGlobal);
Vmath::Vsub(nGlobDofs,
pInput.get(),1,
tmp.get(), 1,
tmp.get(), 1);
pInput.get(), 1,
tmp.get(), 1,
tmp.get(), 1);
}
Array<OneD, NekDouble> offsetarray;
SolveLinearSystem(nGlobDofs, tmp + nDirDofs,
offsetarray = pOutput + nDirDofs, pLocToGloMap, nDirDofs);
tmp2 = tmp + nDirDofs,
pLocToGloMap, nDirDofs);
}
else
{
SolveLinearSystem(pLocToGloMap->GetNumGlobalCoeffs(), pInput,pOutput, pLocToGloMap);
Vmath::Vcopy(nGlobDofs, pInput, 1, tmp, 1);
SolveLinearSystem(nDirDofs, tmp, tmp, pLocToGloMap);
}
Vmath::Vadd(nGlobDofs, tmp + nDirDofs, 1, pOutput + nDirDofs, 1,
tmp2 = pOutput + nDirDofs, 1);
}
......
......@@ -128,37 +128,36 @@ namespace Nektar
int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
int nLocDofs = pLocToGloMap->GetNumLocalCoeffs();
int nDirTotal = nDirDofs;
expList->GetComm()->AllReduce(nDirTotal, LibUtilities::ReduceSum);
Array<OneD, NekDouble> tmp(nGlobDofs);
if(nDirTotal)
{
// calculate the Dirichlet forcing
Array<OneD, NekDouble> global_tmp(nGlobDofs);
Array<OneD, NekDouble> offsetarray;
if(dirForcCalculated)
{
Vmath::Vsub(nGlobDofs, pInput.get(), 1,
pDirForcing.get(), 1,
global_tmp.get(), 1);
tmp.get(), 1);
}
else
{
// Calculate the dirichlet forcing B_b (== X_b) and
// substract it from the rhs
expList->GeneralMatrixOp(
m_linSysKey,
pOutput, global_tmp, eGlobal);
m_linSysKey, pOutput, tmp, eGlobal);
Vmath::Vsub(nGlobDofs, pInput.get(), 1,
global_tmp.get(), 1,
global_tmp.get(), 1);
Vmath::Vsub(nGlobDofs, pInput.get(), 1,
tmp.get(), 1,
tmp.get(), 1);
}
if (vCG)
{
SolveLinearSystem(nGlobDofs, global_tmp, pOutput, pLocToGloMap, nDirDofs);
SolveLinearSystem(
nGlobDofs, tmp, tmp, pLocToGloMap, nDirDofs);
}
else
{
......@@ -167,8 +166,12 @@ namespace Nektar
}
else
{
SolveLinearSystem(nGlobDofs, pInput, pOutput, pLocToGloMap);
SolveLinearSystem(nGlobDofs, tmp, tmp, pLocToGloMap);
}
Array<OneD, NekDouble> tmp2 = pOutput + nDirDofs;
Vmath::Vadd(nGlobDofs - nDirDofs,
tmp + nDirDofs, 1, tmp2, 1, tmp2, 1);
}
......
......@@ -185,8 +185,7 @@ namespace Nektar
if(nGlobHomBndDofs)
{
// construct boundary forcing
if( nIntDofs && ((nDirBndDofs) && (!dirForcCalculated)
&& (atLastLevel)) )
if( nIntDofs && ((!dirForcCalculated) && (atLastLevel)) )
{
//include dirichlet boundary forcing
DNekScalBlkMat &BinvD = *m_BinvD;
......@@ -194,8 +193,7 @@ namespace Nektar
pLocToGloMap->GlobalToLocalBnd(V_GlobBnd,V_LocBnd);
V_LocBnd = BinvD*F_Int + SchurCompl*V_LocBnd;
}
else if((nDirBndDofs) && (!dirForcCalculated)
&& (atLastLevel))
else if((!dirForcCalculated) && (atLastLevel))
{
//include dirichlet boundary forcing
DNekScalBlkMat &SchurCompl = *m_schurCompl;
......
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