On Mon, Jun 27, 2011 at 9:34 AM, Alexander Grayver <span dir="ltr">&lt;<a href="mailto:agrayver@gfz-potsdam.de">agrayver@gfz-potsdam.de</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks Barry,<br>
<br>
Now I get this:</blockquote><div><br></div><div>Please send the entire error message (this is missing the stack), but I am guessing you</div><div>are not changed the default preconditioner (ILU) which cannot act on a shell matrix. Use</div>
<div>-ksp_view to see what solver is begin used.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
[0]PETSC ERROR: --------------------- Error Message ----------------------------<br>
--------<br></div>
[0]PETSC ERROR: No support for this operation for this object type!<br>
[0]PETSC ERROR: Mat type shell!<div class="im"><br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br>
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20 14:26:37 CST 20<br>
10<br>
[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br></div>
[0]PETSC ERROR: test.exe on a cygwin<br>
-cx named MT0. by Unknown Mon Jun 27 16:30:42 2011<div class="im"><br>
[0]PETSC ERROR: Libraries linked from /cygdrive/d/dev/petsc-3.1-p7/<u></u>cygwin-cxx-de<br>
bug/lib<br>
[0]PETSC ERROR: Configure run at Fri Mar  4 10:10:06 2011<br>
[0]PETSC ERROR: Configure options --with-cc=&quot;win32fe cl&quot; --with-fc=&quot;win32fe ifor<br>
t&quot; --with-cxx=&quot;win32fe cl&quot; --with-windows-graphics=0 --download-f-blas-lapack=1<br>
--with-precision=double --with-scalar-type=complex --with-clanguage=cxx --with-m<br>
pi-include=/cygdrive/d/Dev/<u></u>HPC_2008_SDK/Include --with-mpi-lib=&quot;[/cygdrive/d/<u></u>Dev<br>
/HPC_2008_SDK/Lib/amd64/msmpi.<u></u>lib,/cygdrive/d/Dev/HPC_2008_<u></u>SDK/Lib/amd64/msmpife<br>
c.lib]&quot; --useThreads=0 --useThreads=0<br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br></div>
[0]PETSC ERROR: MatNorm() line 4512 in src/mat/interface/D:\dev\<u></u>PETSC-3.1-P\src\mat\INTERF~1\<u></u>matrix.c<div><div></div><div class="h5"><br>
<br>
On <a href="tel:27.06.2011%2016" value="+12706201116" target="_blank">27.06.2011 16</a>:32, Barry Smith wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
   You should pass H as third argument to KSPSetOperators() as well as the second.<br>
<br>
   Barry<br>
<br>
On Jun 27, 2011, at 9:23 AM, Alexander Grayver wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hello!<br>
<br>
I&#39;m using matrix-free formulation and KSPLSQR to solve normal equations system:<br>
<br>
(A&#39;*A)b = -g<br>
<br>
I managed to write all necessary code:<br>
<br>
  call MatCreateShell(MPI_COMM_WORLD,<u></u>m,N,N,N,PETSC_NULL_INTEGER,H,<u></u>ierr)<br>
  call MatShellSetOperation(H,MATOP_<u></u>MULT,MFMatMult,ierr)<br>
<br>
  call KSPCreate(MPI_COMM_WORLD,ksp,<u></u>ierr);CHKERRQ(ierr)<br>
  call KSPSetType(ksp,KSPLSQR,ierr);<u></u>CHKERRQ(ierr)<br>
  call KSPGetPC(ksp,pc,ierr);CHKERRQ(<u></u>ierr)<br>
  call PCSetType(pc,PCNONE,ierr);<u></u>CHKERRQ(ierr)<br>
  call KSPSetOperators(ksp,H,PETSC_<u></u>NULL_OBJECT,SAME_<u></u>PRECONDITIONER,ierr);CHKERRQ(<u></u>ierr)<br>
  call KSPSolve(ksp,g,b,ierr);<u></u>CHKERRQ(ierr)<br>
<br>
<br>
but fail in KSPSolve stage with that:<br>
[0]PETSC ERROR: --------------------- Error Message ----------------------------<br>
--------<br>
[0]PETSC ERROR: Object is in wrong state!<br>
[0]PETSC ERROR: Mat object&#39;s type is not set: Argument # 1!<br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br>
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 7, Mon Dec 20 14:26:37 CST 20<br>
10<br>
[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br></div></div>
[0]PETSC ERROR: test.exe on a cygwin<div class="im"><br>
-cx named MT0. by Unknown Mon Jun 27 16:18:43 2011<br>
[0]PETSC ERROR: Libraries linked from /cygdrive/d/dev/petsc-3.1-p7/<u></u>cygwin-cxx-de<br>
bug/lib<br>
[0]PETSC ERROR: Configure run at Fri Mar  4 10:10:06 2011<br>
[0]PETSC ERROR: Configure options --with-cc=&quot;win32fe cl&quot; --with-fc=&quot;win32fe ifor<br>
t&quot; --with-cxx=&quot;win32fe cl&quot; --with-windows-graphics=0 --download-f-blas-lapack=1<br>
--with-precision=double --with-scalar-type=complex --with-clanguage=cxx --with-m<br>
pi-include=/cygdrive/d/Dev/<u></u>HPC_2008_SDK/Include --with-mpi-lib=&quot;[/cygdrive/d/<u></u>Dev<br>
/HPC_2008_SDK/Lib/amd64/msmpi.<u></u>lib,/cygdrive/d/Dev/HPC_2008_<u></u>SDK/Lib/amd64/msmpife<br>
c.lib]&quot; --useThreads=0 --useThreads=0<br>
[0]PETSC ERROR: ------------------------------<u></u>------------------------------<u></u>----<br>
--------<br>
[0]PETSC ERROR: MatNorm() line 4507 in src/mat/interface/D:\dev\<u></u>PETSC-3.1-P\src\mat\INTERF~1\<u></u>matrix.c<br>
[0]PETSC ERROR: KSPSolve_LSQR() line 90 in src/ksp/ksp/impls/lsqr/D:\dev\<u></u>PETSC-3.1-P\src\ksp\ksp\impls\<u></u>lsqr\lsqr.c<br>
<br>
Any suggestions? Do I have to set MATOP_NORM operation? Then how?<br>
<br>
Regards,<br>
Alexander<br>
</div></blockquote></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>