xref: /petsc/src/dm/tests/ex12.m (revision 6a98f8dc3f2c9149905a87dc2e9d0fedaf64e09a)
1function ex12(np,opt)
2%
3%   ex12(np)
4% creates a series of vectors in PETSc and displays them in Matlab
5%
6% Run with option -on_error_attach_debugger to debug
7%
8%  Requires the Matlab mex routines in ${PETSC_DIR}/share/petsc/matlab and ${PETSC_DIR}/${PETSC_ARCH}/lib/matlab.
9%  Make sure that ${PETSC_DIR}/share/petsc/matlab and ${PETSC_DIR}/${PETSC_ARCH}/lib/matlab is in your MATLABPATH or
10%  $prefix/share/petsc/matlab and $prefix/lib/matlab if you ran ./configure with --prefix
11%
12if (nargin < 1)
13  np = 1;
14end
15if (nargin < 2)
16  opt = ' ';
17end
18time = 20;
19launch(['./ex12 -time ' int2str(time)  opt],np);
20
21p = PetscOpenSocket;
22for i=1:time,
23  v = PetscBinaryRead(p);
24  plot(v);
25  pause(1);
26end;
27close(p);
28