[petsc-users] Load Vec from 1D HDF5 dataset MATT READ THIS EMAIL!

Håkon Strandenes haakon at hakostra.net
Fri Mar 20 10:01:22 CDT 2015


That formulation is obviously not one of my best. I did not mean that it 
was consistent with respect to what is done or not done in Python.

My point was that when using DMDA's in PETSc, you consistently 
"disregard" the dof when dof=1, i.e. create 3D arrays instead of 4D (for 
a 3D DMDA). A dump from an HDF5 file (written by PETSc) where I have 
saved two fields (on 20x20x1 grid cells), one with dof=1 and one with 
dof=3 looks like:

U                        Dataset {1, 20, 20, 3}
p                        Dataset {1, 20, 20}

I think that in case you choose to stick to the policy of adding another 
dimension for bs=1, you should also add that dimension for a DMDA Vec 
with dof=1.

Håkon


On 20. mars 2015 15:29, Jed Brown wrote:
> Håkon Strandenes <haakon at hakostra.net> writes:
>> I think this "special treatment" of DMDA Vecs with dof=1 is a consistent
>> behaviour.
>
> Why is it more consistent?  There are many places in the Python standard
> libraries where tuples of size 1 are returned for the analogue of dof=1,
> instead of implicitly unwrapping that case and leaving it to the caller
> to handle each case separately.
>


More information about the petsc-users mailing list