mirror of
https://github.com/LCPQ/DEHam
synced 2024-12-21 20:03:40 +01:00
trying to read array elements
This commit is contained in:
parent
85b10c2f62
commit
098f2bbdec
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user