Pull out get_center() into a separate method.

This should work around an apparent gcc bug that corrupted
the result of get_bounding_box(grid_) and thus caused
isosurface calculation to segfault.