<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" 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="divtagdefaultwrapper" 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 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">
<div><span style="color:rgb(255,0,0)">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</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 http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.<br>
[0]PETSC ERROR: Petsc Development GIT revision: unknown  GIT Date: unknown<br>
[0]PETSC ERROR: ../Forse/JM62-FORSE/petsc-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/mat/interface/matrix.c<br>
[0]PETSC ERROR: #2 SNESComputeJacobianDefault() line 64 in /opt/petsc/petsc-infconv/src/snes/interface/snesj.c<br>
[0]PETSC ERROR: #3 oursnesjacobian() line 97 in /opt/petsc/petsc-infconv/src/snes/interface/ftn-custom/zsnesf.c<br>
[0]PETSC ERROR: #4 SNESComputeJacobian() line 2374 in /opt/petsc/petsc-infconv/src/snes/interface/snes.c<br>
[0]PETSC ERROR: #5 SNESSolve_NEWTONLS() line 222 in /opt/petsc/petsc-infconv/src/snes/impls/ls/ls.c<br>
[0]PETSC ERROR: #6 SNESSolve() line 4179 in /opt/petsc/petsc-infconv/src/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_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,size,ierr)<br>
                call MPI_Comm_rank(PETSC_COMM_SELF,rank,ierr)<br>
<br>
                <br>
                call VecCreateSeq(PETSC_COMM_SELF,n,x,ierr)<br>
                call VecCreateSeq(PETSC_COMM_SELF,n,r,ierr)<br>
                <br>
                call SNESCreate(PETSC_COMM_SELF,snes,ierr)<br>
                call SNESSetApplicationContext(snes,userCtxptrs,ierr);CHKERRA(ierr)<br>
                <br>
                call SNESSetFunction(snes,r,FormFunction,userCtxptrs,ierr);CHKERRA(ierr)<br>
                call MatCreateSnesMF(snes,JMF,ierr) <br>
                call MatMFFDWPSetComputeNormU(JMF,PETSC_FALSE,ierr)<br>
<br>
                call SNESSetJacobian(snes,Jmf,Jmf,SNESComputeJacobianDefault,userCtxptrs,ierr)<br>
<div>                call SNESSetUseMatrixFree(self%snes,PETSC_TRUE,PETSC_TRUE,ierr)<br>
</div>
                call SNESSetConvergenceTest(snes,MySNESConverged,userCtxptrs,PETSC_NULL_FUNCTION,ierr)<br>
                <br>
                call SNESSetConvergedReason(snes,2,ierr)<br>
                call SNESSetNormSchedule(snes,SNES_NORM_ALWAYS,ierr)<br>
<br>
                call SnesSetTolerances(snes,1.d-8,1.d-7,1.d-7,10,25,ierr)<br>
                call SNESSetFromOptions(snes,ierr);CHKERRA(ierr)<br>
                call SNESView(snes,PETSC_VIEWER_STDOUT_SELF,ierr)<br>
              <br>
                call getpointersUserCtx(ds,pt,TypeY,TypeF,userCtxptrs)<br>
                call FormInitialGuess(x,pt)<br>
               <br>
                call SNESsolve(snes,PETSC_NULL_VEC,x,ierr)<br>
               <br>
                call SNESGetConvergedReason(snes,reason,ierr)<br>
                IF (reason .eq. 2 ) then <br>
                    call VecGetArrayReadF90(x,xx,ierr)<br>
                    pt%Y = xx<br>
                    call VecRestoreArrayReadF90(x,xx,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<br>
</div>
<br>
Fadi<br>
</div>
<br>
<br>
</div>
<br>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" 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>
</body>
</html>