44 namespace MultiRegions
57 "PETSc Full Matrix.");
63 const boost::weak_ptr<ExpList> &pExp,
64 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
68 const int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
70 int i, j, n, cnt, gid1, gid2, loc_lda;
76 pLocToGloMap->GetGlobalToUniversalMapUnique(),
83 for(n = cnt = 0; n <
m_expList.lock()->GetNumElmts(); ++n)
86 loc_lda = loc_mat->GetRows();
88 for(i = 0; i < loc_lda; ++i)
90 gid1 = pLocToGloMap->GetLocalToGlobalMap(cnt+i) - nDirDofs;
91 sign1 = pLocToGloMap->GetLocalToGlobalSign(cnt + i);
95 for(j = 0; j < loc_lda; ++j)
97 gid2 = pLocToGloMap->GetLocalToGlobalMap(cnt + j)
99 sign2 = pLocToGloMap->GetLocalToGlobalSign(cnt + j);
103 value = sign1*sign2*(*loc_mat)(i,j);
105 m_matrix, gid1ro, gid2ro, value, ADD_VALUES);
114 MatAssemblyBegin(
m_matrix, MAT_FINAL_ASSEMBLY);
115 MatAssemblyEnd (
m_matrix, MAT_FINAL_ASSEMBLY);
121 SetUpSolver(pLocToGloMap->GetIterativeTolerance());
135 const Array<OneD, const NekDouble> &pInput,
136 Array<OneD, NekDouble> &pOutput,
138 const Array<OneD, const NekDouble> &pDirForcing)
140 bool dirForcCalculated = (bool) pDirForcing.num_elements();
141 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
142 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
143 Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
145 int nDirTotal = nDirDofs;
146 m_expList.lock()->GetComm()->GetRowComm()->AllReduce(
152 if(dirForcCalculated)
156 pDirForcing.get(), 1,
172 Array<OneD, NekDouble> out(nGlobDofs,0.0);
174 Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
175 &pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);