The differentiation operators create values which might be discontinuous from element to element. The same effect is created by regionally dependent parameters. This causes no problem for terms that are subsequently integrated; in fact, the assembly process cannot detect the discontinuity. However, if the results are assigned to a global vector using the V000 mechanism, the nodal values which differ from element to element have to be averaged. This does not cause problems for graphical purposes such as when, for example, you want to plot a flux by differentiating, but you should never feed those averaged results back as data to another problem. It is far more accurate to recalculate them at the local level, where the discontinuity will be accurately handled.
As an example, suppose you have a Laplace equation in a unit circle,
![]()
e D_j {(X2<0.5) ? 1 : 5} D_j U1
taking advantage of the ternary operator [
see the on-line
Reference Manual for details] or
e D_j {V101} D_j U1
with V101 set to (X2 < 0.5) ? 1 : 5 at the global level.
These will actually give different answers, both inaccurate. The
accurate way is to create two regions, 1 for
P 1 k 1.0
P 2 k 5.0
...
e D_j {k} D_j U1