| 231 | |
| 232 | |
| 233 | void AMG_H1 :: ComputeMatrices (const BaseSparseMatrix & mat) |
| 234 | { |
| 235 | pmat = &mat; |
| 236 | |
| 237 | if (0) // if (prol) |
| 238 | { |
| 239 | // define smoothing blocks |
| 240 | int nv = prol->Width(); |
| 241 | Array<int> cnt(nv); |
| 242 | cnt = 0; |
| 243 | for (int i = 0; i < prol->Height(); i++) |
| 244 | for (int j = 0; j < prol->GetRowIndices(i).Size(); j++) |
| 245 | cnt[prol->GetRowIndices(i)[j]]++; |
| 246 | |
| 247 | Table<int> smblocks(cnt); |
| 248 | cnt = 0; |
| 249 | for (int i = 0; i < prol->Height(); i++) |
| 250 | for (int j = 0; j < prol->GetRowIndices(i).Size(); j++) |
| 251 | { |
| 252 | int jj = prol->GetRowIndices(i)[j]; |
| 253 | smblocks[jj][cnt[jj]] = i; |
| 254 | cnt[jj]++; |
| 255 | } |
| 256 | // *testout << "prol = " << endl << *prol << endl; |
| 257 | // *testout << "smoothing blocks = " << endl << *smblocks << endl; |
| 258 | |
| 259 | bjacobi = mat.CreateBlockJacobiPrecond (make_shared<Table<int>> (smblocks)); |
| 260 | } |
| 261 | jacobi = mat.CreateJacobiPrecond (); |
| 262 | |
| 263 | if (recAMG) |
| 264 | { |
| 265 | coarsemat = shared_ptr<BaseSparseMatrix>(mat.Restrict (*prol)); |
| 266 | recAMG -> ComputeMatrices (*coarsemat); |
| 267 | inv = 0; |
| 268 | } |
| 269 | else |
| 270 | { |
| 271 | mat.SetInverseType ("sparsecholesky"); |
| 272 | inv = mat.InverseMatrix(); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | size_t AMG_H1 :: NZE() const |
| 277 | { |
nothing calls this directly
no test coverage detected