Potential-energy function for large carbon clusters