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