Sorry for the confusion. <div>I use only one DA parallel layout for my problem in spite of the fact that I use MAC-staggered grid (I added one extra cell to the end of the domain in each direction so that I overcome the difficulty of one extra cell associated with each velocity in the corresponding direction, i.e. one extra u-grid exists in x-direction or one extra v-grid exists in y-direction). </div>
<div>So, the vectors (global and locals) are derived from same DA but they do not refer to the same physical location. </div><div>I could fix this if I create DA for each velocity and scalar components and set the coordinates for each of them separately, but I would rather not do this at this point. </div>
<div><br></div><div>I hope I was clear. </div><div>Best, </div><div>Mohamad</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Thu, Jan 19, 2012 at 3:20 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 19, 2012 at 5:19 PM, Mohamad M. Nasr-Azadani <span dir="ltr"><<a href="mailto:mmnasr@gmail.com" target="_blank">mmnasr@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks Mat, <div><div>Use the DA coordinate mechanism and you can get the coordinates as a parallel Vec.</div><div></div></div><div><br></div><div>well, that won't be working for me since although I use one DA and the parallel vectors derived from same DA, yet I am using staggered grid formulation. So, there the coordinates could be different for different vectors. </div>
<div>Is there any other way around this ?</div></blockquote><div><br></div></div><div>I do not understand what you mean, be more specific.</div><div><br></div><div> Matt</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="gmail_quote">On Thu, Jan 19, 2012 at 6:59 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, Jan 19, 2012 at 2:50 AM, Mohamad M. Nasr-Azadani <span dir="ltr"><<a href="mailto:mmnasr@gmail.com" target="_blank">mmnasr@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys, <div><br></div><div>I have compiled petsc to use HDF5 package. </div><div><br></div><div>I like to store the data from a parallel vector(s) (obtained from structured DA in 3 dimensions) to file using VecView() in conjunction with <span style="font-family:monospace;white-space:pre-wrap"><font size="4">PetscViewerHDF5Open(). </font></span></div>
<div>I followed the example here <a href="http://www.mcs.anl.gov/petsc/petsc-current/src/dm/examples/tutorials/ex10.c.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/src/dm/examples/tutorials/ex10.c.html</a></div>
<div>and everything looks fine. </div>
<div><br></div><div>However, I had a couple questions: </div><div><br></div><div>1- When I am done writing the parallel vector obtained from the DA (and PETSC_COMM_WORLD), </div><div><span style="white-space:pre-wrap;font-family:monospace"><br>
</span></div><div><span style="white-space:pre-wrap;font-family:monospace">// Create the HDF5 viewer</span></div><div><span style="white-space:pre-wrap;font-family:monospace"> </span><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerHDF5Open.html#PetscViewerHDF5Open" style="white-space:pre-wrap;font-family:monospace" target="_blank">PetscViewerHDF5Open</a><span style="white-space:pre-wrap;font-family:monospace">(</span><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PETSC_COMM_WORLD.html#PETSC_COMM_WORLD" style="white-space:pre-wrap;font-family:monospace" target="_blank">PETSC_COMM_WORLD</a><span style="white-space:pre-wrap;font-family:monospace">,</span><font color="#666666" style="white-space:pre-wrap;font-family:monospace">"gauss.h5"</font><span style="white-space:pre-wrap;font-family:monospace">,FILE_MODE_WRITE,&H5viewer);</span></div>
<div><span style="white-space:pre-wrap;font-family:monospace">// Write the H5 file</span></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecView.html#VecView" style="white-space:pre-wrap;font-family:monospace" target="_blank">VecView</a><span style="white-space:pre-wrap;font-family:monospace">(gauss,H5viewer);</span></div>
<div><span style="white-space:pre-wrap;font-family:monospace">// Cleaning stage</span></div><div><span style="white-space:pre-wrap;font-family:monospace"> </span><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerDestroy.html#PetscViewerDestroy" style="white-space:pre-wrap;font-family:monospace" target="_blank">PetscViewerDestroy</a><span style="white-space:pre-wrap;font-family:monospace">(&H5viewer);</span></div>
<div><span style="white-space:pre-wrap;font-family:monospace"><br></span></div><div>how can I add data that are just simple 1-D numbers stored on local arrays. </div>
<div>
Easier said, I would like to add the structured grid coordinates (first all x's, then all y's, and then all z's) at the end (or to the beginning) of each data (*.h5) file. But the grid coordinates are stored locally on each machine and not derived from any parallel vectors or DA. I was thinking about creating vectors and viewers using PETSC_COMM_SELF but i am not sure if that is the right approach since that vector is created on all processors locally. </div>
</blockquote><div><br></div></div><div>Use the DA coordinate mechanism and you can get the coordinates as a parallel Vec.</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>2- When using VecView() and HDF5 writer, what is the status of data compression? </div><div>The reason that I am asking is that, I used the same example above and comparing two files saved via two different PetscViewers, i.e. (just) Binary and HDF5 (Binary) the size is not reduced in the (*.h5) case. </div>
<div>In fact, it is slightly bigger than pure binary file!!</div><div>Is there any command we have to set in Petsc to tell HDF5 viewer to use data compression? </div></blockquote><div><br></div></div><div>We do not support it. We are happy to take patches that enable this.</div>
<div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Thanks for your patience, </div>
<div>
Best, </div><span><font color="#888888"><div>Mohamad</div><div><br></div><div><br></div><div><br></div>
<div><br></div>
</font></span></blockquote></div></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br>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<br>
</font></span></font></span></blockquote></div><br></div>
</blockquote></div></div></div><div class="HOEnZb"><div class="h5"><br><br clear="all"><div><br></div>-- <br>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<br>
</div></div></blockquote></div><br></div>