Petsc: From grid to "normal" indexing



Hi there!

I have another Petsc question: I am using DACreate3D to access matrix
and vector elements via an i,j,k-gridordering. Now I am trying to solve
the following problem:

I created a matrix
ierr = DAGetMatrix (da,MATSEQAIJ,gridoperator);
setting values with
ierr = MatSetValuesStencil
(*gridoperator,1,&row,7,col,val,INSERT_VALUES);

For a fixed index (i,j,k) I am trying to find out which row and column
I'm in, i.e a mapping (i,j,k)->(row,col) of the matrix.

I'd be grateful for any suggestions and help.

Margrit

.


Quantcast