2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-12-22 04:13:44 +01:00

trying to read array elements

This commit is contained in:
vijay gopal chilkuri 2016-12-21 11:53:13 +01:00
parent 85b10c2f62
commit 098f2bbdec

View File

@ -211,17 +211,19 @@ int main(int argc,char **argv)
if (nconv>0) {
for (i=0;i<nev;i++) {
/*
Get converged eigenpairs: i-th eigenvalue is stored in kr (real part) and
ki (imaginary part)
*/
ierr = EPSGetEigenpair(eps,i,&kr,&ki,xr,xi);CHKERRQ(ierr);
ierr = EPSGetEigenpair(eps,1,&kr,&ki,xr,xi);CHKERRQ(ierr);
ierr = VecNorm(xr, NORM_2, &norm);CHKERRQ(ierr);
PetscPrintf(PETSC_COMM_WORLD," Norm = %18f \n", (double)norm);
for (i=Istart; i<Iend; i+=getdata.nnz) {
ierr = VecGetValue(xr, 1, i, value);
PetscPrintf(PETSC_COMM_WORLD," Element # = %d Value = %18f \n", i, value[0]);
}
}
ierr = PetscPrintf(PETSC_COMM_WORLD,"\n");CHKERRQ(ierr);
}