Multigrid starting from other level than finest does not work with adaptive refinement

23 views
Skip to first unread message

Michał Wichrowski

unread,
Jan 15, 2019, 5:32:12 AM1/15/19
to deal.II User Group
Dear all,
I am able to reproduce the problem with modified step-37, I expect the similar problem in case of multigrid with sparse matrices. The problem occurs only if mesh is refined adaptively.
I added  refine_mesh() function and  modified solve():

//........
//work on level 3, that is not the finest level
    unsigned int lvl=3;
  mg.reinit(0, lvl);
//..........
//..........
//Set new rhs vector of propper size
    LinearAlgebra::distributed::Vector<float> rhs_lvl;
    mg_matrices[lvl].get_matrix_free()-> initialize_dof_vector(rhs_lvl);
    LinearAlgebra::distributed::Vector<float> sol=rhs_lvl;
//fill rhs_lvl with anything:
    rhs_lvl=1;
  pcout  << " rhs size (1) :  "<<rhs_lvl.size()<<std::endl;

//Test multigrid preconditioner
  preconditioner.vmult(rhs_lvl,sol );


The result is:


Vectorization over 4 doubles = 256 bits (AVX), VECTORIZATION_LEVEL=2
Cycle 0
Number of degrees of freedom: 27150
Total setup time               (wall) 15.1388s
 rhs size (1) :  4913

--------------------------------------------------------
An error occurred in line <487> of file </home/mwichro/lib/dealii/include/deal.II/multigrid/mg_transfer.templates.h> in function
    void dealii::MGLevelGlobalTransfer<dealii::LinearAlgebra::distributed::Vector<Number, dealii::MemorySpace::Host> >::copy_to_mg(const dealii::DoFHandler<dim, spacedim>&, dealii::MGLevelObject<dealii::LinearAlgebra::distributed::Vector<Number, dealii::MemorySpace::Host> >&, const dealii::LinearAlgebra::distributed::Vector<Number2>&, bool) const [with int dim = 3; Number2 = float; int spacedim = 3; Number = float]
The violated condition was: 
    (ghosted_global_vector.local_size()) == (src.local_size())
Additional information: 
    Dimension 27150 not equal to 4913.

Stacktrace:
-----------
#0  /home/mwichro/lib/deal.II/lib/libdeal_II.g.so.9.1.0-pre: void dealii::MGLevelGlobalTransfer<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >::copy_to_mg<3, float, 3>(dealii::DoFHandler<3, 3> const&, dealii::MGLevelObject<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&, bool) const
#1  /home/mwichro/lib/deal.II/lib/libdeal_II.g.so.9.1.0-pre: void dealii::MGLevelGlobalTransfer<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >::copy_to_mg<3, float, 3>(dealii::DoFHandler<3, 3> const&, dealii::MGLevelObject<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&) const
#2  ./step-37: void dealii::internal::PreconditionMGImplementation::vmult<3, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>, dealii::MGTransferMatrixFree<3, float>, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >(std::vector<dealii::DoFHandler<3, 3> const*, std::allocator<dealii::DoFHandler<3, 3> const*> > const&, dealii::Multigrid<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >&, dealii::MGTransferMatrixFree<3, float> const&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&, bool, dealii::mg::Signals const&, ...)
#3  ./step-37: void dealii::PreconditionMG<3, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>, dealii::MGTransferMatrixFree<3, float> >::vmult<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >(dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&) const
#4  ./step-37: Step37::LaplaceProblem<3>::solve()
#5  ./step-37: Step37::LaplaceProblem<3>::run()
#6  ./step-37: main
--------------------------------------------------------
step-37.cc
Reply all
Reply to author
Forward
0 new messages