[cleanup] Simplify index computation in LagrangeDGPreBasis
With this patch the element offset is computed once per element
and not once per basis function. Using if constexpr
instead
of switch
also makes this slightly more readable (no need to
escape switch
with continue
).