updated compute_grad with the latest isodual3D_types.h