[petsc-dev] KSP accepts mismatched sizes between Mat and PC

Smith, Barry F. bsmith at mcs.anl.gov
Mon Apr 16 13:56:27 CDT 2018


Normally they need to be the same, but not always. For KSPLSQR the A matrix may be rectangular but the B matrix is A^TA which is square. This special case is why we don't do error checking.

    Barry


> On Apr 16, 2018, at 1:04 PM, Alp Dener <alp.dener at gmail.com> wrote:
> 
> Hi Barry,
> 
> While I was working on some active-set related stuff in TAO, I discovered that I can call KSPSetOperators() with differently sized Mat and PC objects without getting any errors or warnings about the size mismatch. Note that my Mat object is explicit, but the PC object is a MATSHELL. Is this intended behavior, or is it a bug? 
> 
>> Alp Dener



More information about the petsc-dev mailing list