ierr = VecDestroy(a);CHKERRQ(ierr); ierr = VecDestroy(b);CHKERRQ(ierr);
ierr = VecAssemblyBegin(X);CHKERRQ(ierr); ierr = VecAssemblyEnd(X);CHKERRQ(ierr); ierr = VecMax( b, &index, &val );CHKERRQ(ierr); PetscPrintf( PETSC_COMM_WORLD, "(max-b) = %f : index = %d \n", val, index ); b is destroyed and then used later. Barry
