On Thu, Jan 15, 2009 at 9:42 AM, Panyasantisuk Jarunan <span dir="ltr"><<a href="mailto:Jarunan.Panyasantisuk@eleves.ec-nantes.fr">Jarunan.Panyasantisuk@eleves.ec-nantes.fr</a>></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'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> Matt<br> </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 <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> a é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>
You should be able to use MatCreateMPIAIJWithSplitArrays(), MatCreateMPIAIJWithArrays() or MatMPIAIJSetPreallocationCSR()<br>
from Fortran. Are you using PETSc 3.0.0?<br>
<br>
The arguments for MatCreateMPIAIJWithArrays() or MatMPIAIJSetPreallocationCSR() have the same meaning<br>
(in fact MatCreateMPIAIJWithArrays() essentially calls MatCreateMPIAIJWithArrays()).<br>
<br>
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 mechanism below works.<br>
<br>
call MatCreate(PETSC_COMM_WORLD,D,ierr)<br>
call MatSetSizes(D,N,N,PETSC_DETERMINE,PETSC_DETERMINE,<br>
$ ierr)<br>
call MatSetType(D,MATMPIAIJ,ierr) ! to set type a parallel matrix<br>
call MatSetFromOptions(D,ierr)<br>
call MatMPIAIJSetPreallocationCSR(D,pointer,Column,v,ierr)<br>
<br>
Where pointer is start-row indices a<br>
Column is local column indices<br>
v is value<br>
<br>
Is there the different beteween the start-row indices in MatMPIAIJSetPreallocationCSR and row indices in 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 MatCreateMPIAIJWithSplitArrays in my program which is written in Fortran:<br>
<br>
call MatCreateMPIAIJWithSplitArrays(PETSC_COMM_WORLD,N,N,<br>
$ PETSC_DETERMINE,PETSC_DETERMINE,pointer,column,v,opointer,<br>
$ oColumn,ov,D,ierr)<br>
<br>
The error is<br>
F:246: undefined reference to `matcreatempiaijwithsplitarrays_'<br>
<br>
I could use MatCreateMPIAIJWithArrays but the off diagonal values 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>