MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Update

Method Update

comp/preconditioner.cpp:426–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 ()

Callers

nothing calls this directly

Calls 15

IMClass · 0.85
CrossFunction · 0.85
SetInverseTypeMethod · 0.80
GetMeshAccessMethod · 0.80
GetFESpaceMethod · 0.80
SupportsUpdateMethod · 0.80
SetPrecisionMethod · 0.80
SetMaxStepsMethod · 0.80
EigenValueMethod · 0.80
StopMethod · 0.80
GetTimeStampFunction · 0.70

Tested by

no test coverage detected