[petsc-users] DM and HDF5 Viewer

Jed Brown jed at jedbrown.org
Thu Jul 16 11:14:50 CDT 2015


Gianluca Meneghello <gianmail at gmail.com> writes:

> 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);

VecSetDM only associates a DM with the Vec.  It does not interpose
itself into VecView.

Should we change this so that creating a Vec of the correct size/block
size/layout and associating a DM is equivalent?  Perhaps, but it's more
nuanced than it might seem.

Why don't you want to just call DMCreateGlobalVector()?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150716/07ef96f6/attachment.pgp>


More information about the petsc-users mailing list