std::distance returns a *signed* integral type, so silence compiler
warnings with an explicit cast.
Store node id as dof_id_type in TopResidualDebugOutputTopResidualData.
Explicitly cast PetscInt's when store back in the NonlinearSystem.
Explicitly cast to PetscInt to avoid implicit sign conversion warnings.