On Thu, Jan 15, 2009 at 9:42 AM, Panyasantisuk Jarunan <span dir="ltr">&lt;<a href="mailto:Jarunan.Panyasantisuk@eleves.ec-nantes.fr">Jarunan.Panyasantisuk@eleves.ec-nantes.fr</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">When I create a matrix with MatCreateMPIAIJWithSplitArrays, as it doesn&#39;t copy the values so I have to use MatSetValues to set the internal value?</blockquote>
<div><br>1) You should upgrade to 3.0.0<br><br>2) You should not have to call MatSetValues(). It will use the arrays you provide.<br><br>&nbsp; Matt<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
-- <br>
Jarunan PANYASANTISUK<br>
MSc. in Computational Mechanics<br>
Erasmus Mundus Master Program<br>
Ecole Centrale de Nantes<br>
1, rue de la noë, 44321 NANTES, FRANCE<br>
<br>
<br>
<br>
Barry Smith &lt;<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>&gt; a Ã&copy;crit :<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
 &nbsp; You should be able to use MatCreateMPIAIJWithSplitArrays(), &nbsp;MatCreateMPIAIJWithArrays() or MatMPIAIJSetPreallocationCSR()<br>
from Fortran. Are you using PETSc 3.0.0?<br>
<br>
 &nbsp; The arguments for MatCreateMPIAIJWithArrays() or &nbsp;MatMPIAIJSetPreallocationCSR() have the same meaning<br>
(in fact MatCreateMPIAIJWithArrays() essentially calls &nbsp;MatCreateMPIAIJWithArrays()).<br>
<br>
 &nbsp; Barry<br>
<br>
On Jan 14, 2009, at 7:38 AM, Panyasantisuk Jarunan wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Oh, I could not use MatCreateMPIAIJWithArrays either but the &nbsp;mechanism below works.<br>
<br>
 &nbsp; &nbsp;call MatCreate(PETSC_COMM_WORLD,D,ierr)<br>
 &nbsp; &nbsp;call MatSetSizes(D,N,N,PETSC_DETERMINE,PETSC_DETERMINE,<br>
 &nbsp; $ &nbsp; &nbsp; ierr)<br>
 &nbsp; &nbsp;call MatSetType(D,MATMPIAIJ,ierr) ! to set type a parallel matrix<br>
 &nbsp; &nbsp;call MatSetFromOptions(D,ierr)<br>
 &nbsp; &nbsp;call MatMPIAIJSetPreallocationCSR(D,pointer,Column,v,ierr)<br>
<br>
Where pointer is start-row indices a<br>
 &nbsp; &nbsp;Column is local column indices<br>
 &nbsp; &nbsp;v is value<br>
<br>
Is there the different beteween the start-row indices in &nbsp;MatMPIAIJSetPreallocationCSR and row indices in &nbsp;MatCreateMPIAIJWithArrays ?<br>
<br>
<br>
<br>
Regards,<br>
Jarunan<br>
<br>
<br>
<br>
<br>
Hello,<br>
<br>
To define a matrix with arrays, I cannot use &nbsp;MatCreateMPIAIJWithSplitArrays in my program which is written in &nbsp;Fortran:<br>
<br>
 &nbsp; &nbsp;call MatCreateMPIAIJWithSplitArrays(PETSC_COMM_WORLD,N,N,<br>
 &nbsp; $ &nbsp; &nbsp; PETSC_DETERMINE,PETSC_DETERMINE,pointer,column,v,opointer,<br>
 &nbsp; $ &nbsp; &nbsp; oColumn,ov,D,ierr)<br>
<br>
The error is<br>
F:246: undefined reference to `matcreatempiaijwithsplitarrays_&#39;<br>
<br>
I could use MatCreateMPIAIJWithArrays but the off diagonal values &nbsp;are missing with this command.<br>
<br>
I would be appreciate for any advice. Thank you before hand.<br>
<br>
Regards,<br>
Jarunan<br>
<br>
<br>
<br>
<br>
-- <br>
Jarunan PANYASANTISUK<br>
MSc. in Computational Mechanics<br>
Erasmus Mundus Master Program<br>
Ecole Centrale de Nantes<br>
1, rue de la noë, 44321 NANTES, FRANCE<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>