If this is OK, I will add a member function as:
```
 void PETScLinearSolver::quit()
{
        PetscPrintf(PETSC_COMM_WORLD, "\nLinear solver (PETSc KSP) failed, quit now.\n");
        KSPDestroy(&_solver);
        PetscFinalize();
}
```