DA question

Amit.Itagi at seagate.com Amit.Itagi at seagate.com
Tue May 6 12:53:10 CDT 2008




> > One question : How compatible is PetSc with Blitz++ ? Can I declare
> > the
> > array to be returned by DAVecGetArray to be a Blitz array ?
>
>    Likely you would need to use VecGetArray() and then somehow build
> the Blitz
> array using the pointer returned and the sizes of the local part of
> the DA.
>
>    If you figure out how to do this then maybe we could have a
> DAVecGetArrayBlitz()
>
>     Barry
>


Barry,

I did some more thinking about this. If I have a standard C array (any
dimension) that is stored in a contiguous block of memory (with regular
ordering), there is a Blitz constructor that can convert it to a Blitz
array.

I took a look at the source of DAVecGetArray. The array generation depends
(in the VecGetArray3d source) on VecGetArray, and a short code that
allocates storage to store the pointers and to do the pointer assignments
to appropriate parts of VecGetArray. Looking at the assignments, it looks
like the 3D array returned by DAVecGetArray has the contiguous, regularly
ordered storage format that Blitz expects. Is this correct ?

Thanks

Rgds,
Amit




More information about the petsc-users mailing list