Thyra: Can't cast DefaultZeroLinearOp to MultiVectorBase
Created by: jmgate
I just ran into an issue working on Charon2 in which Teko::getBlock()
returned a Thyra::DefaultZeroLinearOp
instead of a Thyra::LinearOpBase
, which was expected by Charon. That's fine—the block was zero so it makes sense. However the next line was to rcp_dynamic_cast
it to a Thyra::MultiVectorBase
, which would work for a LinearOpBase
(if that block hadn't been zero), but doesn't for a DefaultZeroLinearOp
. There may be a perfectly good reason for that behavior, but speaking from a perspective of complete ignorance, I would expect to be able to get a multi-vector of all zeros out of a zero linear operator. My work-around for the time being is simply to check if I get a DefaultZeroLinearOp
back from getBlock()
and then proceed accordingly, but it doesn't seem like that should be necessary. Again, speaking from inexperience with Thyra here—if there's a good reason for this behavior, feel free to close the issue.
@trilinos/thyra @trilinos/teko