<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello, <br>
<br>
I am quite new to petsc and therefore my question might be quite
trivial.<br>
<br>
I have a 1D finite difference code and want to store several vectors
in a binary:<br>
<span style="color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-style: normal; font-variant: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align: -webkit-auto;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(213, 234,
255); font-size: medium; font-weight: bold; "></span><span
class="Apple-style-span" style="color: rgb(0, 0, 0); font-family:
'Times New Roman'; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(213, 234,
255); font-size: medium; display: inline !important; float: none;
"></span><br>
ierr =
PetscViewerCreate(PETSC_COMM_WORLD,&viewer);CHKERRQ(ierr);<br>
ierr =
PetscViewerBinaryOpen(PETSC_COMM_WORLD,"out.bin",FILE_MODE_APPEND,&viewer);
CHKERRQ(ierr);<br>
ierr = PetscObjectSetName((PetscObject)u,"u");CHKERRQ(ierr);<br>
ierr = PetscObjectSetName((PetscObject)rhs,"rhs");CHKERRQ(ierr);<br>
ierr = VecView(u,viewer); CHKERRQ(ierr);<br>
ierr = VecView(rhs,viewer);CHKERRQ(ierr);<br>
<br>
However, when I read the file with matlab (PetscBinaryRead.m) I only
get the first vector.<br>
<br>
In further application I would like to use something similar but
putting out the solution vector every timestep.<br>
<br>
Could someone just provide me some sample code?<br>
<br>
Thanks, <br>
Robert<br>
<br>
<br>
</body>
</html>