<div class="gmail_extra">Mark :</div><div class="gmail_extra">Shall C=PtAP inherit the block size of A?</div><div class="gmail_extra">Currently, MatPtAP() is only implemented with aij bs=1.</div><div class="gmail_extra">Hong<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Apr 24, 2012, at 2:55 PM, Barry Smith wrote:<br>
<br>
><br>
> On Apr 24, 2012, at 1:39 PM, Mark F. Adams wrote:<br>
><br>
>> Now I'm getting this error with code like this:<br>
>><br>
>> ierr = MatGetSubMatrix( Cmat, new_eq_indices, new_eq_indices, MAT_INITIAL_MATRIX, &mat );<br>
>> CHKERRQ(ierr);<br>
>> ierr = MatSetBlockSize( mat, cbs ); CHKERRQ(ierr);<br>
>><br>
>> and like this:<br>
>><br>
>> ierr = MatPtAP( Amat_fine, Pold, MAT_INITIAL_MATRIX, 2.0, &Cmat ); CHKERRQ(ierr);<br>
>> ierr = MatSetBlockSize( Cmat, cbs ); CHKERRQ(ierr);<br>
><br>
> Right you cannot do this. The matrix already exists so you cannot now set its size.<br>
><br>
> Does Cmat have a block size of cbs<br>
><br>
> What about Amat? By default these routines should create the new matrix with the correct blocksize.<br>
><br>
> The harder part is if the blocksize of mat would be different than Cmat?<br>
><br>
<br>
</div>It seems like MatGetSubMatrix should just inherit the block size but PtAP is harder. The block size of the Cmat is the column block size of P. But I can not set a column block size (!= row block size) so I don't set block size on P at all. Here cbs is this column block size of P, or what it should be.<br>
<span class="HOEnZb"><font color="#888888"><br>
Mark<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> Barry<br>
><br>
>><br>
>> Mark<br>
>><br>
>> On Apr 23, 2012, at 9:09 PM, Barry Smith wrote:<br>
>><br>
>>><br>
>>> Yes, look, for example how ex32 is handled at the bottom of the makefile.<br>
>>><br>
>>> Thanks<br>
>>><br>
>>> Barry<br>
>>><br>
>>> On Apr 23, 2012, at 5:50 PM, Mark F. Adams wrote:<br>
>>><br>
>>>><br>
>>>> On Apr 23, 2012, at 5:59 PM, Barry Smith wrote:<br>
>>>><br>
>>>>><br>
>>>>> It was changed a while ago that MatSetBlockSize() couldn't be set after the matrix was full instantiated. I guess that example did not get fixed because it is not listed in the makefile to run in the makeall.<br>
>>>><br>
>>>> May I add it?<br>
>>>><br>
>>>>><br>
>>>>> I have fixed the example to call MatSetBlockSize() at a safe point.<br>
>>>>><br>
>>>>> Barry<br>
>>>>><br>
>>>>> On Apr 23, 2012, at 4:29 PM, Mark F. Adams wrote:<br>
>>>>><br>
>>>>>> ex55.c in ksp is failing with:<br>
>>>>>><br>
>>>>>> [0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
>>>>>> [0]PETSC ERROR: Arguments are incompatible!<br>
>>>>>> [0]PETSC ERROR: Cannot change block size 1 to 2!<br>
>>>>>> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
>>>>>><br>
>>>>>> on this line 57 of ex55.c:<br>
>>>>>><br>
>>>>>> ierr = MatSetBlockSize(Amat,2); CHKERRQ(ierr);<br>
>>>>>><br>
>>>>>> Any idea what happened here?<br>
>>>>>><br>
>>>>>> Mark<br>
>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>>><br>
>><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>