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