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