<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 16, 2018 at 1:26 PM, El Haddad, Fadi <span dir="ltr"><<a href="mailto:f.el-haddad@imperial.ac.uk" target="_blank">f.el-haddad@imperial.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-7137893733482512022divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div id="gmail-m_-7137893733482512022divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Hello Petsc Users,</div>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
I am trying to set up a snes matrix free solver into an existing code.</div>
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
I obtained the following log error by petsc :</div></div></div></blockquote><div><br></div><div>Setting it up is a little tricky, Why not just omit SNESSetJacobian() and it will automatically set it up?</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-7137893733482512022divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div><span style="color:rgb(255,0,0)">[0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--</span><br>
[0]PETSC ERROR: No support for this operation for this object type<br>
[0]PETSC ERROR: Mat type mffd<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Development GIT revision: unknown  GIT Date: unknown<br>
[0]PETSC ERROR: ../Forse/JM62-FORSE/petsc-<wbr>infconv/forse on a arch-linux2-c-debug named me-felhadda by felhadda Tue Jan 16 12:49:53 2018<br>
[0]PETSC ERROR: Configure options --with-cc=mpicc --with-cxx=mpic++ --with-fc=mpif90 --with-mpi-dir=/usr/lib/mpich --download-fblaslapack<br>
[0]PETSC ERROR: #1 MatZeroEntries() line 5617 in /opt/petsc/petsc-infconv/src/<wbr>mat/interface/matrix.c<br>
[0]PETSC ERROR: #2 SNESComputeJacobianDefault() line 64 in /opt/petsc/petsc-infconv/src/<wbr>snes/interface/snesj.c<br>
[0]PETSC ERROR: #3 oursnesjacobian() line 97 in /opt/petsc/petsc-infconv/src/<wbr>snes/interface/ftn-custom/<wbr>zsnesf.c<br>
[0]PETSC ERROR: #4 SNESComputeJacobian() line 2374 in /opt/petsc/petsc-infconv/src/<wbr>snes/interface/snes.c<br>
[0]PETSC ERROR: #5 SNESSolve_NEWTONLS() line 222 in /opt/petsc/petsc-infconv/src/<wbr>snes/impls/ls/ls.c<br>
[0]PETSC ERROR: #6 SNESSolve() line 4179 in /opt/petsc/petsc-infconv/src/<wbr>snes/interface/snes.c<br>
<br>
</div>
<br>
<div>Have anyone dealt with a similar error? I copied my snes matrix free set up here below :
<br>
</div>
<div><br>
</div>
<div>
<div>
<div><br>
                external :: FormFunction<br>
                external :: MySNESConverged<br>
<br>
<br>
                call PetscInitialize(PETSC_NULL_<wbr>CHARACTER,ierr)<br>
                if (ierr .ne. 0) then<br>
                        print*,'Unable to initialize PETSc'<br>
                        stop<br>
                endif<br>
                call MPI_Comm_size(PETSC_COMM_SELF,<wbr>size,ierr)<br>
                call MPI_Comm_rank(PETSC_COMM_SELF,<wbr>rank,ierr)<br>
<br>
                <br>
                call VecCreateSeq(PETSC_COMM_SELF,<wbr>n,x,ierr)<br>
                call VecCreateSeq(PETSC_COMM_SELF,<wbr>n,r,ierr)<br>
                <br>
                call SNESCreate(PETSC_COMM_SELF,<wbr>snes,ierr)<br>
                call SNESSetApplicationContext(<wbr>snes,userCtxptrs,ierr);<wbr>CHKERRA(ierr)<br>
                <br>
                call SNESSetFunction(snes,r,<wbr>FormFunction,userCtxptrs,ierr)<wbr>;CHKERRA(ierr)<br>
                call MatCreateSnesMF(snes,JMF,ierr) <br>
                call MatMFFDWPSetComputeNormU(JMF,<wbr>PETSC_FALSE,ierr)<br>
<br>
                call SNESSetJacobian(snes,Jmf,Jmf,<wbr>SNESComputeJacobianDefault,<wbr>userCtxptrs,ierr)<br>
<div>                call SNESSetUseMatrixFree(self%<wbr>snes,PETSC_TRUE,PETSC_TRUE,<wbr>ierr)<br>
</div>
                call SNESSetConvergenceTest(snes,<wbr>MySNESConverged,userCtxptrs,<wbr>PETSC_NULL_FUNCTION,ierr)<br>
                <br>
                call SNESSetConvergedReason(snes,2,<wbr>ierr)<br>
                call SNESSetNormSchedule(snes,SNES_<wbr>NORM_ALWAYS,ierr)<br>
<br>
                call SnesSetTolerances(snes,1.d-8,<wbr>1.d-7,1.d-7,10,25,ierr)<br>
                call SNESSetFromOptions(snes,ierr);<wbr>CHKERRA(ierr)<br>
                call SNESView(snes,PETSC_VIEWER_<wbr>STDOUT_SELF,ierr)<br>
              <br>
                call getpointersUserCtx(ds,pt,<wbr>TypeY,TypeF,userCtxptrs)<br>
                call FormInitialGuess(x,pt)<br>
               <br>
                call SNESsolve(snes,PETSC_NULL_VEC,<wbr>x,ierr)<br>
               <br>
                call SNESGetConvergedReason(snes,<wbr>reason,ierr)<br>
                IF (reason .eq. 2 ) then <br>
                    call VecGetArrayReadF90(x,xx,ierr)<br>
                    pt%Y = xx<br>
                    call VecRestoreArrayReadF90(x,xx,<wbr>ierr)<br>
                    ConvFlag = True<br>
                ELSE<br>
                    ConvFlag = False<br>
                ENDIF</div>
<div><br>
</div>
<div>Am I missing a crucial subroutine call?  <br>
</div>
<div>Thank you for the help<span class="gmail-HOEnZb"><font color="#888888"><br>
</font></span></div><span class="gmail-HOEnZb"><font color="#888888">
<br>
Fadi<br>
</font></span></div>
<br>
<br>
</div>
<br>
<p></p>
<div id="gmail-m_-7137893733482512022Signature">
<div id="gmail-m_-7137893733482512022divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
<p></p>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>