fixed an energy bug

Energy depends on partition which means local term does too.