41 namespace MultiRegions
81 const boost::weak_ptr<ExpList> &pExp,
82 const boost::shared_ptr<AssemblyMap>
89 "This routine should only be used when using a Full Direct"
91 ASSERTL1(pExp.lock()->GetComm()->GetSize() == 1,
92 "Direct full matrix solve can only be used in serial.");
108 const Array<OneD, const NekDouble> &pInput,
109 Array<OneD, NekDouble> &pOutput,
111 const Array<OneD, const NekDouble> &pDirForcing)
113 bool dirForcCalculated = (bool) pDirForcing.num_elements();
114 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
115 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
116 Array<OneD, NekDouble> tmp(nGlobDofs);
121 if(dirForcCalculated)
125 pDirForcing.get(), 1,
140 Array<OneD, NekDouble> out(nGlobDofs,0.0);
142 Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
143 &pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
160 int i,j,n,cnt,gid1,gid2;
162 int totDofs = pLocToGloMap->GetNumGlobalCoeffs();
163 int NumDirBCs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
165 unsigned int rows = totDofs - NumDirBCs;
166 unsigned int cols = totDofs - NumDirBCs;
170 int bwidth = pLocToGloMap->GetFullSystemBandWidth();
181 if( (2*(bwidth+1)) < rows)
218 for(n = cnt = 0; n <
m_expList.lock()->GetNumElmts(); ++n)
221 loc_lda = loc_mat->GetRows();
223 for(i = 0; i < loc_lda; ++i)
225 gid1 = pLocToGloMap->GetLocalToGlobalMap(cnt + i)-NumDirBCs;
226 sign1 = pLocToGloMap->GetLocalToGlobalSign(cnt + i);
229 for(j = 0; j < loc_lda; ++j)
231 gid2 = pLocToGloMap->GetLocalToGlobalMap(cnt + j)
233 sign2 = pLocToGloMap->GetLocalToGlobalSign(cnt + j);
240 if((matStorage ==
eFULL)||(gid2 >= gid1))
242 value = Gmat->GetValue(gid1,gid2)
243 + sign1*sign2*(*loc_mat)(i,j);
244 Gmat->SetValue(gid1,gid2,value);