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

difference inner, dot

+7 votes

Is there a difference between

dot(u, v)

and

inner(u, v)

for vector-valued functions u, v?

asked Jul 16, 2013 by nschloe FEniCS User (7,120 points)

1 Answer

+11 votes
 
Best answer

Yes, inner(u, v)$=u_{ijk\ldots}v_{ijk\ldots}$, dot(u, v)$=u_{ijk\ldots n}v_{nmo\ldots}$ (summation implied).

Now I read "$u$, $v$ vector-valued", then answer is no:)

answered Jul 16, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Jul 16, 2013 by nschloe

Can you give an trivial example about this?

V = VectorFunctionSpace(mesh, 'CG', 2)
Q = FunctionSpace(mesh, 'CG', 1)

u = Function(V) # velocity
p = Function(Q) # pressure

I = Identity(V.cell().d)
T = -p*I + 2.0*mu*sym(grad(u))) # Cauchy stress (for isochoric motion of Newtonian fluid)

traction = dot(T, n) # for n unit normal of respective surface

stress_power = inner(T, grad(u))

When u, v are vectors (only have one index ) not tensor.
inner(u , v) = u_i v_i
dot(u,v) = u_i v_i
Does than mean they are the same or my understanding was wrong?
Thanks :)

Does than mean they are the same or my understanding was wrong?

Sure.

The are the same for first order tensors, but not for second order tensors.

inner(u_ij, v_kl) = u_ij v_ij
dot(u_ij, v_k) = u_ij v_jk

...