<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Daer Barry:<div> Matrix A is the coeffcients not the mesh. I use the MatPermute following the ksp examples in dev version ex18. </div><div>After the line 77, we declared a parallel matrix , at line 78, we declare a seq matrix.</div><div>so what is this seq matrix for ?</div><div><pre width="80" style="line-height: normal; "><a name="line77"> 77: </a> <a href="file:///G:/Downlaod/petsc-dev/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html#MatMPIAIJSetPreallocation">MatMPIAIJSetPreallocation</a>(A,5,NULL,5,NULL);
<a name="line78"> 78: </a> <a href="file:///G:/Downlaod/petsc-dev/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html#MatSeqAIJSetPreallocation">MatSeqAIJSetPreallocation</a>(A,5,NULL);</pre></div><div><br><br><br><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2013-09-17 00:19:39,"Barry Smith" <bsmith@mcs.anl.gov> wrote:
>
> I assume that his matrix A is suppose to represent the connections in the mesh.
>
> 1) You only want to reorder the mesh locally (assuming you have already partitioned the mesh in parallel for good load balancing and low number of cut eges) so each process will call MatCreate() with PETSC_COMM_SELF and each set a matrix associated only with the local part of the mesh.
>
> 2) You don't want to use MatPermute() rather you would use MatGetOrdering() which tells you how to reorder the unknowns on the mesh on each process. For the ordering I think you want to use MATORDERINGRCM. Now you just renumber the mesh nodes on each process and update the the ghost node information to reflect the new ordering.
>
> Barry
>
>
>On Sep 16, 2013, at 7:14 AM, ¶¡ÀÏʦ <ztdepyahoo@163.com> wrote:
>
>> i set up my matrix A with
>> MatCreate(PETSC_COMM_WORLD,&A);
>> MatSetSizes(A,PMesh->LocalSize,PMesh->LocalSize,PETSC_DECIDE,PETSC_DECIDE);
>> MatSetFromOptions(A);
>> MatMPIAIJSetPreallocation(A,5,PETSC_NULL,5,PETSC_NULL);
>>
>>
>> then which type should i use to support the matpermute.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> < span title="neteasefooter">
>
</pre></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>