<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 29, 2015 at 4:00 PM, Håkon Strandenes <span dir="ltr"><<a href="mailto:haakon@hakostra.net" target="_blank">haakon@hakostra.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Den 2015-03-29 21:48, skrev Matthew Knepley:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But of course there already is a PETSc-specific HDF5 format. Someone<br>
made up "/MESH/nodes/x". This is the essence of HDF5,<br>
XML, etc. that they are not actually formats, but rather storage<br>
technologies like the UNIX filesystem. Someone still has to declare<br>
a format, and we do.<br>
<br>
However, if you want the data array to be 1D in any old HDF5 tool,<br>
except when complex is used, except when timestepping is used,<br>
then Yes, we need to make an exception for blocksize. I just think we<br>
will end up changing this back when it becomes apparent that<br>
having to put a check in all these HDF5 tools as well is onerous.<br>
<br>
   Matt<br>
</blockquote>
<br></span>
My problem, as previously written, is that in the HDF5 output, you do already disregard dimensions with size one, all the time, except when dealing with the block size. Why?? Just think of the following cases:<br>
<br>
1: When you create a dof=1 DMDA, that dof is not added as an extra dimension in the HDF5 output. Why don't you always create this dimension? When you create a dof=2 or dof=3, you suddenly write one extra dimension.<br></blockquote><div><br></div><div>Yep, I don't like this either</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2: When you create a 2D DMDA (or 1D), you do not have that third dimension in the output. Why isn't a 2D grid just a special case of 3D with one dimension where the size is one?<br></blockquote><div><br></div><div>True</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3: When you do not use complex numbers, you do not have that extra dimension in the HDF5 output. Why don't you always add one extra dimension here in order to be consistent?<br></blockquote><div><br></div><div>I really hate this, but type handling is so weak in C and HDF5.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
4: When you do not use timestepping, this temporal dimension is not added in the HDF5 output. Why don't you always add one extra dimension for time, just to avoid having to check for it? You coud treat "no timestepping" as "timestep 1"?<br></blockquote><div><br></div><div>Yep.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So the ONLY TIME you always add one dimension of size 1 is when dealing with the block size. In more or less all other cases you disregard these one-size dimensions and tries to compact the dataset into as few dimensions as possible. This is HIGHLY non-consistent and non-intuitive.<br>
<br>
Is it really that hard to handle this "last special case", and suddenly get a consistent HDF5 output format?<br></blockquote><div><br></div><div>Okay, I am convinced by the timestepping and dimension. Unstructured grids turn out to be much more beautiful</div><div>since there is none of this messing around.</div><div><br></div><div>I guess we should document this somewhere since the PETSc HDF5 format is not completely obvious.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
Håkon<br>
<br>
(I know that I can make a 3D DMDA with one or two dimensions of size 1, and then have one or two dimension of size 1 in the HDF5 output, but that is really the only case I can think of. This is however not an issue, since it is explicitly declared a 3D case, and the user then expect 3D output)<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>