No, because of assembly function. Also, I can not use static or dynamic cast for the first argument of  PetscObjectSetName.