This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Discontinuous Galerkin / jump operators

+2 votes

Hello,
Is the following jump operator implemented in fenics

$$[ u ] = u^+ \otimes n^+ + u^- \otimes n^-$$

where u is a vector and

$$u \otimes n = (u_i n_j)_{(ij)}$$

Thank you

asked Jul 1, 2013 by micdup FEniCS User (1,120 points)
edited Jul 1, 2013 by micdup

Shouldn't there be plus or minus sign between outer products in the first equation?

hoops ... very sorry for the mistakes.

[ u ] = u^+ \otimes n^+ + u^- \otimes u^-

u \otimes n = (u_i n_j)_{(ij)}

Ok, answer given. Please, edit question appropriately.

1 Answer

+2 votes
 
Best answer
def tensor_jump(u, n):
    return outer(u('+'), n('+')) + outer(u('-'), n('-'))
answered Jul 1, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Jul 2, 2013 by Jan Blechta

Thank you very much !

jump(outer(u, n))

represents rather $u^+ \otimes n^+ - u^- \otimes n^-$ according to ufl/ufl/operators.py. Correct answer is

def tensor_jump(u, n):
    return outer(u('+'), n('+')) + outer(u('-'), n('-'))

Answer edited. One can mask it into jump(v, n) function using compound outer operator

def tensor_jump(u, n):
    return jump(outer(u, n, n), n)

but that's rather obfuscation than simplification.

Or

def tensor_jump(u, n):
    dim = n.shape()[0]
    I = Identity(dim)
    return jump(outer(u, I), n)

It is clear with the definition given in ufl/ufl/operators.py.
Thank you very much for your help.

...