Hi,
I am about to use PETSc linear algebra. Two questions.
Q1: I have the stiffness matrix and the rhs vector assembled (outside)
and in PETSc order. Do I still need to create a scatter:"ierr =
VecScatterCreate(bb,isglobal,localX,islocal,&scatter)"?
Q2: I have PETSc vectors and matrix set:
ierr = VecCreate(MPI_COMM_WORLD,&bb);CHKERRQ(ierr);
ierr = VecSetFromOptions(bb);CHKERRQ(ierr);CHKPT
ierr = VecSetSizes(bb,Nvlocal,Nvglobal);CHKERRQ(ierr);
ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);
ierr = MatSetSizes(A,Nvlocal,Nvlocal,Nvglobal,Nvglobal);CHKERRQ(ierr);
I passed the rhs myData to bb using VecSetValues:
ierr = VecSetValues(bb,Nvlocal,vertices,myData,INSERT_VALUES);CHKERRQ(ierr);
The matrix is in HYPRE sparse format. What is the recommended way to
pass it to A?
Thanks in advance,
--Ted