<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
I am trying to obtain the value of each element of a solution Vector by KSPsolve(). <BR>
<BR>
The variables are defined according the example of ex4f90.F in \petsc-3.1-p5\src\snes\examples\tutorials\ as following,<BR>
<BR>
PetscScalar, pointer :: xx_v(:)<BR>
<BR>
...<BR>
call KSPSolve(ksp,b,x,ierr)<BR>
call VecView(x,PETSC_VIEWER_STDOUT_WORLD,ierr)<BR><BR>
call VecGetArrayF90(x,xx_v,ierr)<BR> call VecRestoreArrayF90(x,xx_v,ierr)<BR>
<BR>
...<BR>
<BR>
But, the error keeps coming out when call VecGetArrayF90(x,xx_v,ierr) and call VecRestoreArrayF90(x,xx_v,ierr) are not commented off.<BR>
<BR>
<BR>The error information shows:<BR>
Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<BR>
<BR>
[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------<BR>[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<BR>[0]PETSC ERROR: INSTEAD the line number of the start of the function<BR>[0]PETSC ERROR: is given.<BR>[0]PETSC ERROR: [0] F90Array1dCreate line 52 src/sys/f90-src/f90_cwrap.c<BR>[0]PETSC ERROR: --------------------- Error Message ------------------------------------<BR>
<BR>
I checked the code according the example, but cannot see any difference to that. Just don't know why the pointer array xx_v doesn't work here? Thanks.<BR><BR><BR>                                            </body>
</html>