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

Method FinalizeLevel

comp/preconditioner.cpp:705–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703 }
704
705 void LocalPreconditioner :: FinalizeLevel (const BaseMatrix * mat)
706 {
707 cout << IM(3) << "Update Local Preconditioner" << flush;
708 timestamp = bfa->GetTimeStamp();
709
710 if (flags.StringFlagDefined("blocktype") || flags.StringListFlagDefined("blocktype"))
711 {
712 if (additional_dirichlet_constraints)
713 flags.SetFlag ("additional_dirichlet_constraints", std::any(*additional_dirichlet_constraints));
714
715 auto blocks = bfa->GetFESpace()->CreateSmoothingBlocks(flags);
716 shared_ptr<BaseMatrix> mat = bfa->GetMatrixPtr();
717 auto spmat = dynamic_pointer_cast<BaseSparseMatrix> (mat);
718
719 if (GaussSeidel)
720 jacobi = make_shared<SymmetricBlockGaussSeidelPrecond>(spmat, blocks);
721 else
722 jacobi = spmat -> CreateBlockJacobiPrecond(blocks);
723
724 /*
725 jacobi = dynamic_cast<const BaseSparseMatrix&> (bfa->GetMatrix())
726 .CreateBlockJacobiPrecond(blocks);
727 */
728 return;
729 }
730
731
732
733 int blocktype = int (flags.GetNumFlag ( "blocktype", -1));
734
735 // if (MyMPI_GetNTasks() != 1) return;
736 bool parallel = (this->on_proc == -1);
737 /*
738 if ( !parallel && id != this->on_proc )
739 {
740 jacobi = 0;
741 return;
742 }
743 */
744
745// BaseBlockJacobiPrecond::COARSE_TYPE bbct;
746// switch ( ct )
747// {
748// case NO_COARSE:
749// bbct = NO_COARSE; break;
750// case DIRECT_COARSE:
751// bbct = DIRECT_COARSE; break;
752// }
753
754 if (blockcreator)
755 {
756 shared_ptr<Table<int>> blocks = blockcreator(*bfa->GetFESpace());
757 // cout << "created blocks: " << *blocks << endl;
758 jacobi = dynamic_cast<const BaseSparseMatrix&> (bfa->GetMatrix())
759 .CreateBlockJacobiPrecond(blocks); // , 0, parallel, bfa->GetFESpace()->GetFreeDofs());
760 return;
761 }
762

Callers

nothing calls this directly

Calls 6

IMClass · 0.85
CreateSmoothingBlocksMethod · 0.80
GetFESpaceMethod · 0.80
SetFlagMethod · 0.45
GetMatrixPtrMethod · 0.45
GetMatrixMethod · 0.45

Tested by

no test coverage detected