basic python and fortran routines designed to work with PETSc and petsc4py