Use the coodinate DA.<br><br> Matt<br><br><div class="gmail_quote">On Fri, Aug 28, 2009 at 2:54 AM, nicolas aunai <span dir="ltr"><<a href="mailto:nicolas.aunai@gmail.com">nicolas.aunai@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
Hum... Yes and no. This function does indeed create a VectorScatter<br>
that allows to go from parallel to sequential and natural vectors, but<br>
the sequential vectors must but structured to receive the DA data. For<br>
example a 2D DA with 3 degree of freedom will require a specific<br>
vector with a global size equal to nx*ny*3<br>
<br>
I want to scatter the coordinates vector obtained with the function<br>
DAGetCoordinates(), which is of size nx*ny*2.<br>
<br>
This is the reason why I was not using the DACreateNaturalVector()<br>
function and then VecScatterCreateToZero(), the natural vector being<br>
created has a wrong size.<br>
<br>
<br>
<br>
<br>
<br>
2009/8/27 Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>>:<br>
<div><div></div><div class="h5">> This should be good enough<br>
><br>
><br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/DA/DAGlobalToNaturalAllCreate.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/DA/DAGlobalToNaturalAllCreate.html</a><br>
><br>
> Matt<br>
><br>
> On Thu, Aug 27, 2009 at 12:51 PM, nicolas aunai <<a href="mailto:nicolas.aunai@gmail.com">nicolas.aunai@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>><br>
>> I have a problem using 'VecScatterCreateToZero'. I attach to this<br>
>> email a test code that illustrates the problem. I create a 2D DA then<br>
>> I ask for the coordinates (that have been set just before), which are<br>
>> returned in a global vector. I want to write the coordinates in a<br>
>> file, so I use 'VecScatterCreateToZero' to put all the values in<br>
>> sequential vector. It seems to work fine but sometimes (depending on<br>
>> the number of proc used) the coordinates in the sequential vectors are<br>
>> ordered differently.<br>
>><br>
>> to run the code and see the problem :<br>
>><br>
>> mpiexec -n 4 ./vecdacoord > problem.txt<br>
>><br>
>> I have attached problem.txt too.<br>
>><br>
>> Is someone can explain to me how I could obtain my coordinates in a<br>
>> natural order ?<br>
>><br>
>><br>
>> Thx<br>
><br>
><br>
><br>
> --<br>
> What most experimenters take for granted before they begin their experiments<br>
> is infinitely more interesting than any results to which their experiments<br>
> lead.<br>
> -- Norbert Wiener<br>
><br>
</div></div></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>