Assemble system with given values for each element

If it is element wise, it could be represented as a DG0 function?
I would assume something similar to this could work Dolfinx discontinous expression (note that this is dolfinx syntax, Which differs slightly from dolfin syntax)