Hello and sorry for a badly formatted text (cell phone).

In brief, I have a code that solves for a temperature and a voltage (mixed elements, and can be found in my post history, but I’ll probably make the link once I am in front of my computer).

From ‘‘temp’’ and ‘‘volt’’, I compute J and Jq, the current density and the heat flux. They involve taking.the gradient of temp and volt. J appears in the heat eq. as a source term.

From J, I compute dJx/dx and similarly for the ‘‘y’’ component, I add those terms to form a source of heat in the heat equation.

Here are my questions:

Physically, the source term is non zero. However, I get that it vanishes if temp and volt are defined in CG spaces of degree 1, J and Jq are then defined in DG spaces of degree 0, and since I then take the spatial derivatives of a cell wise constant field, I get 0. This makes some sense.

Therefore, if I,want to compute the source term accurately, I need to increase the degrees of all FE spaces. And I don’t know if I can choose a CG space of degree 2 for temp and volt. Because then I,could take CG spaces of deg 1 for J and.Jq, but then this would make a space DG of degree 0 for the source term. And this source term is used to compute temp and volt. In other words, a discontinuous Galerkin space would be used to get a solution that would be continuous Galerkin. Is that possible? Is this mathematically allowed?

If not, does this mean that if I want a real estimate or computation of the solution to the coupled PDEs, I should use DG for all spaces?