42 namespace MultiRegions
61 const boost::weak_ptr<ExpList> &pExp,
62 const boost::shared_ptr<AssemblyMap>
69 "This routine should only be used when using a Full XXT"
87 const Array<OneD, const NekDouble> &pInput,
88 Array<OneD, NekDouble> &pOutput,
90 const Array<OneD, const NekDouble> &pDirForcing)
92 bool dirForcCalculated = (bool) pDirForcing.num_elements();
93 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
94 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
96 Array<OneD, NekDouble> tmp (nGlobDofs);
97 Array<OneD, NekDouble> tmp2(nGlobDofs);
98 Array<OneD, NekDouble> tmp3 = pOutput + nDirDofs;
103 if(dirForcCalculated)
106 pDirForcing.get(), 1,
125 tmp, tmp2, pLocToGloMap);
136 tmp,tmp2, pLocToGloMap);
142 tmp2 + nDirDofs, 1, tmp3, 1, tmp3, 1);
152 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
154 const Array<OneD, const int> &vMap
155 = pLocToGloMap->GetLocalToGlobalMap();
156 unsigned int nGlo = pLocToGloMap->GetNumGlobalCoeffs();
157 unsigned int nEntries = pLocToGloMap->GetNumLocalCoeffs();
161 Array<OneD, NekDouble> vCounts(nGlo, 0.0);
162 for (i = 0; i < nEntries; ++i)
164 vCounts[vMap[i]] += 1.0;
168 pLocToGloMap->UniversalAssemble(vCounts);
172 for (i = 0; i < nEntries; ++i)
177 m_map = pLocToGloMap->GetLocalToGlobalMap();
187 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
190 unsigned int nElmt = vExp->GetNumElmts();
192 unsigned int iCount = 0;
193 unsigned int rCount = 0;
194 unsigned int nRows = 0;
195 unsigned int nEntries = 0;
196 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
197 unsigned int nLocal = pLocToGloMap->GetNumLocalCoeffs();
198 const Array<OneD, NekDouble> &vMapSign
199 = pLocToGloMap->GetLocalToGlobalSign();
200 bool doSign = pLocToGloMap->GetSignChange();
201 unsigned int i = 0, j = 0, k = 0, n = 0;
203 Array<OneD, unsigned int> vSizes(nElmt);
212 for (n = 0; n < nElmt; ++n)
214 i = vExp->GetOffset_Elmt_Id(n);
215 vSizes[n] = vExp->GetExp(i)->GetNverts();
216 nEntries += vSizes[n]*vSizes[n];
221 for (n = 0; n < nElmt; ++n)
223 i = vExp->GetOffset_Elmt_Id(n);
224 vSizes[n] = vExp->GetExp(i)->GetNcoeffs();
225 nEntries += vSizes[n]*vSizes[n];
230 m_Ai = Array<OneD, unsigned int>(nEntries);
231 m_Aj = Array<OneD, unsigned int>(nEntries);
232 m_Ar = Array<OneD, double>(nEntries, 0.0);
235 Array<OneD, unsigned long> vId(nLocal);
239 for(n = iCount = 0; n < nElmt; ++n)
241 loc_mat =
GetBlock(vExp->GetOffset_Elmt_Id(n));
242 nRows = loc_mat->GetRows();
244 for(i = 0; i < nRows; ++i)
246 gid1 = pLocToGloMap->GetLocalToGlobalMap(iCount + i);
247 for(j = 0; j < nRows; ++j)
249 k = rCount + i*vSizes[n] + j;
250 m_Ai[k] = iCount + i;
251 m_Aj[k] = iCount + j;
252 m_Ar[k] = (*loc_mat)(i,j);
255 m_Ar[k] *= vMapSign[iCount+i]*vMapSign[iCount+j];
261 if (gid1 < numDirBnd)
268 = pLocToGloMap->GetGlobalToUniversalMap(gid1);
272 rCount += vSizes[n]*vSizes[n];