43 namespace MultiRegions
59 "Iterative static condensation.");
63 "XxtMultiLevelStaticCond",
65 "Xxt multi-level static condensation.");
88 const boost::weak_ptr<ExpList> &pExpList,
89 const boost::shared_ptr<AssemblyMap>
97 "This constructor is only valid when using static "
100 == pLocToGloMap->GetGlobalSysSolnType(),
101 "The local to global map is not set up for the requested "
111 const boost::weak_ptr<ExpList> &pExpList,
116 const boost::shared_ptr<AssemblyMap>
143 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
145 const Array<OneD, const int> &vMap
146 = pLocToGloMap->GetLocalToGlobalBndMap();
147 unsigned int nGlo = pLocToGloMap->GetNumGlobalBndCoeffs();
148 unsigned int nEntries = pLocToGloMap->GetNumLocalBndCoeffs();
152 Array<OneD, NekDouble> vCounts(nGlo, 0.0);
153 for (i = 0; i < nEntries; ++i)
155 vCounts[vMap[i]] += 1.0;
159 pLocToGloMap->UniversalAssembleBnd(vCounts);
163 for (i = 0; i < nEntries; ++i)
168 m_map = pLocToGloMap->GetLocalToGlobalBndMap();
177 boost::shared_ptr<AssemblyMap> pLocToGloMap)
182 unsigned int nElmt =
m_schurCompl->GetNumberOfBlockRows();
184 unsigned int iCount = 0;
185 unsigned int rCount = 0;
186 unsigned int nRows = 0;
187 unsigned int nEntries = 0;
188 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
189 unsigned int nLocal = pLocToGloMap->GetNumLocalBndCoeffs();
190 const Array<OneD, NekDouble> &vMapSign
191 = pLocToGloMap->GetLocalToGlobalBndSign();
192 bool doSign = pLocToGloMap->GetSignChange();
193 unsigned int i = 0, j = 0, k = 0, n = 0;
195 Array<OneD, unsigned int> vSizes(nElmt);
199 for (n = 0; n < nElmt; ++n)
202 vSizes[n] = loc_mat->GetRows();
203 nEntries += vSizes[n]*vSizes[n];
207 m_Ai = Array<OneD, unsigned int>(nEntries);
208 m_Aj = Array<OneD, unsigned int>(nEntries);
209 m_Ar = Array<OneD, double>(nEntries, 0.0);
212 Array<OneD, unsigned long> vId(nLocal);
216 for(n = iCount = 0; n < nElmt; ++n)
219 nRows = loc_mat->GetRows();
221 for(i = 0; i < nRows; ++i)
223 gid1 = pLocToGloMap->GetLocalToGlobalBndMap(iCount + i);
224 for(j = 0; j < nRows; ++j)
226 k = rCount + i*vSizes[n] + j;
227 m_Ai[k] = iCount + i;
228 m_Aj[k] = iCount + j;
229 m_Ar[k] = (*loc_mat)(i,j);
232 m_Ar[k] *= vMapSign[iCount+i]*vMapSign[iCount+j];
238 if (gid1 < numDirBnd)
245 = pLocToGloMap->GetGlobalToUniversalBndMap()[gid1];
249 rCount += vSizes[n]*vSizes[n];
260 const boost::weak_ptr<ExpList> &pExpList,
265 const boost::shared_ptr<AssemblyMap> &l2gMap)
269 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap);
270 sys->Initialise(l2gMap);