MultigridStep does not actually check if TransferOperators are set
Although the preprocess
method seems to test for the transfer operators, there is no mechanism to check if the transfer operators have been set at all. Since not calling the setTransferOperators
method results in the derived number of levels to be deduced as 0, no error occurs. I understand that a trivial setup (i.e. no transfer hierarchy) should not cause failure.
I believe there was such a check back in 2012 when the number of levels was not deduced from the transfer operators given. While I do not support reintroducing a parameter for the expected number of levels, I would expect some kind of safety to protect users of this class from believing to use a multigrid scheme while actually only solving with the base solver.
Maybe an approach could be to require the setTransferOperators
method to be called (and check a corresponding flag when preprocessing).