<div dir="ltr"><div>In my first program I have already set the name for the solution. Vec U has the name "pressure".<br><br></div>In my second program, how do I obtain and use/load "pressure"? Would I have to use PetscObjectQuery somehow?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 6:00 PM, 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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Mar 31, 2015 at 5:54 PM, Justin Chang <span dir="ltr"><<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Matt thanks for the responses. I plan on loading the solution sol.h5 obtained from one program into another (as the auxiliary). So in my other program, I am solving a different problem but on the same mesh. I have the following lines in my other code:<br></div></div></div></blockquote><div><br></div></span><div>Yes, if you want to do this, you have to give these vectors proper names:</div><div><br></div><div> PetscObjectSetName((PetscObject), U, "solution");</div><div><br></div><div> Thanks,</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 dir="ltr"><div><div>ierr = PetscViewerHDF5Open(PETSC_COMM_SELF,"sol.h5",FILE_MODE_READ,&viewer);CHKERRQ(ierr);<br>ierr = VecLoad(auxVec,&viewer);CHKERRQ(ierr);<br>ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);<br><br></div>But when this program reaches VecLoad i get the following errors:<br><br>HDF5-DIAG: Error detected in HDF5 (1.8.12) MPI-process 0:<br> #000: H5D.c line 334 in H5Dopen2(): not found<br> major: Dataset<br> minor: Object not found<br> #001: H5Gloc.c line 430 in H5G_loc_find(): can't find object<br> major: Symbol table<br> minor: Object not found<br> #002: H5Gtraverse.c line 861 in H5G_traverse(): internal path traversal failed<br> major: Symbol table<br> minor: Object not found<br> #003: H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed<br> major: Symbol table<br> minor: Callback failed<br> #004: H5Gloc.c line 385 in H5G_loc_find_cb(): object 'Vec_0x7f9831516fb0_0' doesn't exist<br> major: Symbol table<br> minor: Object not found<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Error in external library<br>[0]PETSC ERROR: Error in HDF5 call H5Dopen2() Status -1<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Development GIT revision: v3.5.3-2528-gbee642f GIT Date: 2015-03-29 20:36:38 -0500<br>[0]PETSC ERROR: ./trans on a arch-darwin-c-debug named <a href="http://CAML-03.CIVE.UH.EDU" target="_blank">CAML-03.CIVE.UH.EDU</a> by jychang48 Tue Mar 31 17:45:38 2015<br>[0]PETSC ERROR: Configure options --download-chaco --download-exodusii --download-fblaslapack --download-hdf5 --download-metis --download-mumps --download-netcdf --download-openmpi --download-parmetis --download-scalapack --download-triangle --with-cc=gcc --with-cmake=cmake --with-cxx=g++ --with-debugging=1 --with-fc=gfortran --with-valgrind=1 CFLAGS= CXXFLAGS= PETSC_ARCH=arch-darwin-c-debug<br>[0]PETSC ERROR: #1 VecLoad_HDF5() line 268 in /Users/jychang48/Software/petsc-dev/src/vec/vec/utils/vecio.c<br>[0]PETSC ERROR: #2 VecLoad_Default() line 391 in /Users/jychang48/Software/petsc-dev/src/vec/vec/utils/vecio.c<br>[0]PETSC ERROR: #3 VecLoad_Plex_Local() line 158 in /Users/jychang48/Software/petsc-dev/src/dm/impls/plex/plex.c<br>[0]PETSC ERROR: #4 VecLoad() line 969 in /Users/jychang48/Software/petsc-dev/src/vec/vec/interface/vector.c<br>[0]PETSC ERROR: #5 CreateMesh() line 265 in /Users/jychang48/Dropbox/Research_Topics/Code_PETSc/Nonneg/trans.c<br>[0]PETSC ERROR: #6 main() line 381 in /Users/jychang48/Dropbox/Research_Topics/Code_PETSc/Nonneg/trans.c<br><br></div>Any idea what's going on here?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 5:46 PM, 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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Mar 31, 2015 at 5:29 PM, Justin Chang <span dir="ltr"><<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How do I invoke this command into my program? When I add "-vec_view hdf5:sol.h5" my program says this has been left out.</div></blockquote><div><br></div></span><div>You can call VecView() directly with an HDF5 Viewer, or I think its easier to call</div><div><br></div><div> VecViewFromOptions(U, NULL, "-vec_view");</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 31, 2015 at 5:13 PM, 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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Mar 31, 2015 at 5:06 PM, Justin Chang <span dir="ltr"><<a href="mailto:jchang27@uh.edu" target="_blank">jchang27@uh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi all,<br><br></div>So in my DMPlex FEM (serial) simulations, I want to output the solution U to a binary file. I have the following:<br><br></div>ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,"sol.dat",FILE_MODE_WRITE,&viewer);CHKERRQ(ierr);<br>ierr = VecView(U,viewer);CHKERRQ(ierr);<br>ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);<br><br></div>The mesh I am solving has 13368 nodes, and 404 of them are constrained using the DMPlexAddBoundary(...) function. However, when I output the vector I only get 12964 values, which I believe is leaving out the 404 constrained ones. How do I get all dofs in the vector U (both free and constrained) printed?<br></div></div></blockquote><div><br></div></span><div>I would use HDF5 which will do this automatically:</div><div><br></div><div> -vec_view hdf5:sol.h5</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>Thanks,<span><font color="#888888"><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div><div>Justin Chang<br></div>PhD Candidate, Civil Engineering - Computational Sciences<br></div>University of Houston, Department of Civil and Environmental Engineering<br></div>Houston, TX 77004<br><a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br></div></div></font></span></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><div>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>
</font></span></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888"><br clear="all"><br>-- <br><div><div dir="ltr"><div><div><div>Justin Chang<br></div>PhD Candidate, Civil Engineering - Computational Sciences<br></div>University of Houston, Department of Civil and Environmental Engineering<br></div>Houston, TX 77004<br><a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br></div></div>
</font></span></blockquote></div></div></div><div><div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><div>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>
</font></span></div></div></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888"><br clear="all"><br>-- <br><div><div dir="ltr"><div><div><div>Justin Chang<br></div>PhD Candidate, Civil Engineering - Computational Sciences<br></div>University of Houston, Department of Civil and Environmental Engineering<br></div>Houston, TX 77004<br><a href="tel:%28512%29%20963-3262" value="+15129633262" target="_blank">(512) 963-3262</a><br></div></div>
</font></span></blockquote></div></div></div><div><div class="h5"><br><br clear="all"><div><br></div>-- <br><div>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></div></div>
</blockquote></div><br></div><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><div>Justin Chang<br></div>PhD Candidate, Civil Engineering - Computational Sciences<br></div>University of Houston, Department of Civil and Environmental Engineering<br></div>Houston, TX 77004<br>(512) 963-3262<br></div></div>