It lets you read a time series of one field without needing to read all fields.
Note that we could implement a "next object" seek functionality that would partly alleviate this issue, but the reader code would still need to know how many fields were interlaced. On Jan 6, 2012 8:58 PM, "Barry Smith" <bsmith at mcs.anl.gov> wrote: > > On Jan 6, 2012, at 6:51 AM, Alexander Grayver wrote: > > > On 06.01.2012 13:45, Jed Brown wrote: > >> On Fri, Jan 6, 2012 at 03:09, Alexander Grayver < > agrayver at gfz-potsdam.de> wrote: > >> This is not always convinient to store everything in one file, but in > some cases I do want to use it. I haven't found any examples on that. Do I > have to use FILE_MODE_APPEND and then write? What happens if file doesn't > exist? > >> > >> You just create a viewer and then call MatView(), VecView(), etc, > repeatedly for each object you want to put in the file (e.g. once per time > step). No need for FILE_MODE_APPEND and unless you want to append to an > existing file. > > > > Ok, that was my meaning to use PetscViewerFileSetName from the beginning > since if you have let's say ten different objects (Mat and Vec) and you > need to output them at each iteration (time step or frequency for > multi-freqs modeling) you need ten viewer objects > > I don't understand why you need ten viewer objects. Why not just dump all > the objects into the one file (creating one Viewer object and never > changing its name) one after each other and then in MATLAB read then back > in one after the other. > > Barry > > > which is not cool I guess, that is why I started to use one viewer and > change just a name of the file. > > And to be honest I don't see any reason why having ten viewers is better > than calling PetscViewerFileSetName ten times. > > > > Regards, > > Alexander > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120108/e421bf1f/attachment.htm>
