[petsc-users] DM and HDF5 Viewer

Gianluca Meneghello gianmail at gmail.com
Thu Jul 16 11:04:38 CDT 2015


Hi again,

I am now trying to write a vector to an HDF5, this time using a DM
structure to impose the vector layout.

Creating the vector with (as in src/dm/examples/tutorials/ex10.c)

DMCreateGlobalVector(da2D,&gauss);

every works fine, i.e. the hdf5 file has the correct layout given by the
dimension of the DM. On the other side, if I use:

VecCreate(PETSC_COMM_WORLD,&gauss);
VecSetSizes(gauss,PETSC_DECIDE,Nx*Ny);
VecSetDM(gauss,da2D);
VecSetFromOptions(gauss);
VecSetUp(gauss);

the hdf5 file contains a single dimension vector, apparently negecting the
VecSetDM instruction (I would need this for vectors created by
MatCreateVecs, in order to have both right and left vectors available).

I did some testing but I did not manage to solve this. Is there anything I
am doing wrong, or is this the way it is supposer to work?

Thanks as always for your help,

Gianluca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150716/caff1c1b/attachment-0001.html>


More information about the petsc-users mailing list