← Back to team overview

dolfin team mailing list archive

Re: [Question #142105]: Making scalar values with Frobenius inner product of two 2nd order tensors

 

Question #142105 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/142105

    Status: Open => Answered

Anders Logg proposed the following answer:
On Wed, Jan 19, 2011 at 08:48:23PM -0000, Sungick Kim wrote:
> New question #142105 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/142105
>
> Hi.
> I want to calculate a scalar value(strain energy) with two 2nd-order tensors.
> In the FFC User manual,
>
> dot(A, B) = A:B =sum(A_ij*B_ij) #When A and B are 2nd-order tensors.
> But it seems not working. When I tried to project the result error poped up.
> Error message is
> 'ufl.log.UFLException: Shape mismatch.'
>
> My code is written below.
>
> Q = FunctionSpace(mesh, "CG", 1)
> P=dot(A, B)
> ans = project(P, Q)

Use inner(A, B) instead of dot(A, B).

You should not be reading the FFC manual which describes the old form
language. Use the new UFL manual instead.

--
Anders

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.