Using petsc in user code