[petsc-users] Question about SNESSetFunction - FormFunction part

최경준 kyungjun.choi92 at gmail.com
Tue Aug 9 15:29:28 CDT 2016


Hi, I'm currently working on FormFunction routine

my subroutine goes like this

--> *subroutine FormFunction(snes, x, f, userctx, ierr)*

Inside the above subroutine, the problem occurs when I try to use
*VecGetArrayF90(x,
xx_v, ierr)*

The error pops up with this kind of message " *Vec is locked read only* "


So I used *VecGetArrayReadF90*, but then I got these below

[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X
to find memory corruption errors
[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: ---------------------  Stack Frames
------------------------------------
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR:       INSTEAD the line number of the start of the function
[0]PETSC ERROR:       is given.
[0]PETSC ERROR: [0] F90Array1dCreate line 50
/home/ckj/Repository/petsc-3.7.3/src/sys/f90-src/f90_cwrap.c
[0]PETSC ERROR: [0] oursnesfunction line 84
/home/ckj/Repository/petsc-3.7.3/src/snes/interface/ftn-custom/zsnesf.c
[0]PETSC ERROR: [0] SNES user function line 2144
/home/ckj/Repository/petsc-3.7.3/src/snes/interface/snes.c
[0]PETSC ERROR: [0] SNESComputeFunction line 2129
/home/ckj/Repository/petsc-3.7.3/src/snes/interface/snes.c
[0]PETSC ERROR: [0] SNESSolve_NEWTONTR line 98
/home/ckj/Repository/petsc-3.7.3/src/snes/impls/tr/tr.c
[0]PETSC ERROR: [0] SNESSolve line 3958
/home/ckj/Repository/petsc-3.7.3/src/snes/interface/snes.c


Please give me some help.

Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160810/e4ab0a29/attachment.html>


More information about the petsc-users mailing list