How to solve local problem for each element cell of the mesh?

You could use something along the lines of:

where you make a local assembler for lhs and rhs and solve for that (ref: Invert DG block diagonal matrix - #5 by rosilho)