| 424 | |
| 425 | |
| 426 | void MGPreconditioner :: Update () |
| 427 | { |
| 428 | static Timer t("MGPreconditioner::Update"); RegionTimer reg(t); |
| 429 | |
| 430 | shared_ptr<BilinearForm> lo_bfa = bfa->GetLowOrderBilinearForm(); |
| 431 | |
| 432 | string invtype, loinvtype = default_inversetype; |
| 433 | invtype = dynamic_cast<const BaseSparseMatrix & > (bfa->GetMatrix()).SetInverseType (inversetype); |
| 434 | if (lo_bfa) |
| 435 | loinvtype = dynamic_cast<const BaseSparseMatrix & > (lo_bfa->GetMatrix()) .SetInverseType (inversetype); |
| 436 | |
| 437 | |
| 438 | mgp->Update(); |
| 439 | |
| 440 | if (coarse_pre) |
| 441 | { |
| 442 | mgp->SetCoarseGridPreconditioner (coarse_pre); |
| 443 | } |
| 444 | |
| 445 | if (bfa->GetLowOrderBilinearForm()) // || ntasks > 1) not supported anymore |
| 446 | { |
| 447 | static Timer t("MGPreconditioner::Update - fine precond"); RegionTimer reg(t); |
| 448 | if (additional_dirichlet_constraints) |
| 449 | flags.SetFlag ("additional_dirichlet_constraints", std::any(*additional_dirichlet_constraints)); |
| 450 | auto fine_smoother = make_shared<BlockSmoother> (*bfa->GetMeshAccess(), *bfa, flags); |
| 451 | fine_smoother -> SetAdditionalDirichletConstraints(additional_dirichlet_constraints); |
| 452 | GetMemoryTracer().Track(*fine_smoother, "FineSmoother"); |
| 453 | tlp = make_shared<TwoLevelMatrix> (&bfa->GetMatrix(), |
| 454 | &*mgp, |
| 455 | fine_smoother, |
| 456 | bfa->GetMeshAccess()->GetNLevels()-1); |
| 457 | tlp -> SetSmoothingSteps (finesmoothingsteps); |
| 458 | if (bfa->GetFESpace()->LowOrderEmbedding()) |
| 459 | tlp->SetEmbedding (bfa->GetFESpace()->LowOrderEmbedding()); |
| 460 | tlp -> Update(); |
| 461 | } |
| 462 | else |
| 463 | tlp = nullptr; |
| 464 | |
| 465 | if (timing) Timing(); |
| 466 | if (test) Test(); |
| 467 | if (mgtest) MgTest(); |
| 468 | |
| 469 | dynamic_cast<const BaseSparseMatrix & > (bfa->GetMatrix()).SetInverseType ( invtype ); |
| 470 | if (lo_bfa) |
| 471 | dynamic_cast<const BaseSparseMatrix & > (lo_bfa->GetMatrix()) .SetInverseType ( loinvtype ); |
| 472 | } |
| 473 | |
| 474 | |
| 475 | void MGPreconditioner :: CleanUpLevel () |
nothing calls this directly
no test coverage detected