Coefficient is custmized for each cell in the weak formulation, pointwise expression on each cell

We cannot run the example you posted and formatting was missing. Please read Read before posting: How do I get my question answered?

That being said, for the second integral you may want to have a look at ufl.CellVolume.