<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Aug 9, 2016 at 3:29 PM, 최경준 <span dir="ltr"><<a href="mailto:kyungjun.choi92@gmail.com" target="_blank">kyungjun.choi92@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, I'm currently working on FormFunction routine<div><br></div><div>my subroutine goes like this</div><div><br></div><div>--> <b>subroutine FormFunction(snes, x, f, userctx, ierr)</b></div><div><br></div><div>Inside the above subroutine, the problem occurs when I try to use <b>VecGetArrayF90(x, xx_v, ierr)</b></div><div><br></div><div>The error pops up with this kind of message " <b>Vec is locked read only</b> "</div></div></blockquote><div><br></div><div>Does SNES ex5f90 run for you? If so, then there must be a problem in your code. I would start with the</div><div>example and change it slowly until you get what you want.</div><div><br></div><div>  Thanks,</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 dir="ltr"><div>So I used <b>VecGetArrayReadF90</b>, but then I got these below</div><div><br></div><div><div>[0]PETSC ERROR: ------------------------------<wbr>------------------------------<wbr>------------</div><div>[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</div><div>[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger</div><div>[0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html#<wbr>valgrind</a></div><div>[0]PETSC ERROR: or try <a href="http://valgrind.org" target="_blank">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors</div><div>[0]PETSC ERROR: likely location of problem given in stack below</div><div>[0]PETSC ERROR: ---------------------  Stack Frames ------------------------------<wbr>------</div><div>[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,</div><div>[0]PETSC ERROR:       INSTEAD the line number of the start of the function</div><div>[0]PETSC ERROR:       is given.</div><div>[0]PETSC ERROR: [0] F90Array1dCreate line 50 /home/ckj/Repository/petsc-3.<wbr>7.3/src/sys/f90-src/f90_cwrap.<wbr>c</div><div>[0]PETSC ERROR: [0] oursnesfunction line 84 /home/ckj/Repository/petsc-3.<wbr>7.3/src/snes/interface/ftn-<wbr>custom/zsnesf.c</div><div>[0]PETSC ERROR: [0] SNES user function line 2144 /home/ckj/Repository/petsc-3.<wbr>7.3/src/snes/interface/snes.c</div><div>[0]PETSC ERROR: [0] SNESComputeFunction line 2129 /home/ckj/Repository/petsc-3.<wbr>7.3/src/snes/interface/snes.c</div><div>[0]PETSC ERROR: [0] SNESSolve_NEWTONTR line 98 /home/ckj/Repository/petsc-3.<wbr>7.3/src/snes/impls/tr/tr.c</div><div>[0]PETSC ERROR: [0] SNESSolve line 3958 /home/ckj/Repository/petsc-3.<wbr>7.3/src/snes/interface/snes.c</div></div><div><br></div><div><br></div><div>Please give me some help.</div><div><br></div><div>Best regards.</div><div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">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></div>