A gradient-based dissipative continuous-time algorithm for distributed optimization