Commit 1bc10e0e authored by Dave Moxey's avatar Dave Moxey
Browse files

Add a messy preallocation to fix logic and get 3D working

parent a47f493d
......@@ -2,7 +2,7 @@ OPTION(NEKTAR_USE_PETSC
"Enable PETSc parallel matrix solver support." OFF)
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_PETSC
"Build PETSc if needed" ON
"Build PETSc if needed" OFF
"NEKTAR_USE_PETSC" OFF)
IF( NEKTAR_USE_PETSC )
......
......@@ -85,6 +85,7 @@ namespace Nektar
// preallocate
int loc_lda;
Array<OneD, int> nnz(nDofs-NumDirBCs, 0);
vector<set<int> > hack(rows);
for(n = cnt = 0; n < m_expList.lock()->GetNumElmts(); ++n)
{
......@@ -94,17 +95,27 @@ namespace Nektar
for(i = 0; i < loc_lda; ++i)
{
gid1 = pLocToGloMap->GetLocalToGlobalMap(cnt + i)-NumDirBCs;
if(gid1 >= 0)
if(gid1 < 0)
{
for(j = 0; j < loc_lda; ++j)
continue;
}
for(j = 0; j < loc_lda; ++j)
{
gid2 = pLocToGloMap->GetLocalToGlobalMap(cnt + j)
- NumDirBCs;
if(gid2 < 0)
{
gid2 = pLocToGloMap->GetLocalToGlobalMap(cnt + j)
- NumDirBCs;
if(gid2 >= 0)
{
nnz[gid1]++;
}
continue;
}
if (hack[gid1].count(gid2) > 0)
{
continue;
}
hack[gid1].insert(gid2);
nnz[gid1]++;
}
}
cnt += loc_lda;
......
......@@ -385,7 +385,8 @@ namespace Nektar
// preallocate
int loc_lda;
Array<OneD, int> nnz(nBndDofs-NumDirBCs, 0);
vector<set<int> > hack(rows);
for(n = cnt = 0; n < m_expList.lock()->GetNumElmts(); ++n)
{
if (m_linSysKey.GetMatrixType() == StdRegions::eHybridDGHelmBndLam)
......@@ -400,17 +401,27 @@ namespace Nektar
for(i = 0; i < loc_lda; ++i)
{
gid1 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + i)-NumDirBCs;
if(gid1 >= 0)
if(gid1 < 0)
{
for(j = 0; j < loc_lda; ++j)
continue;
}
for(j = 0; j < loc_lda; ++j)
{
gid2 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + j)
- NumDirBCs;
if(gid2 < 0)
{
gid2 = pLocToGloMap->GetLocalToGlobalBndMap(cnt + j)
- NumDirBCs;
if(gid2 >= 0)
{
nnz[gid1]++;
}
continue;
}
if (hack[gid1].count(gid2) > 0)
{
continue;
}
hack[gid1].insert(gid2);
nnz[gid1]++;
}
}
cnt += loc_lda;
......
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