dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #12550
Re: Petrov-Galerkin FEM (Upwinding)
On Thu, Mar 05, 2009 at 02:40:51PM -0500, Hatef Monajemi wrote:
> regardless of what operator you use ffc gives the following error:
>
>
>
> "Dimensions don't match for scalar product."
>
>
>
> try for example :
>
>
>
> (v,w)= (v+v, w)
>
> Is there a way to get around this?
>
> Hatef
I checked and the problem is that v is a Python list with two elements
v = [v[0], v[1]]
When you write v + v, the Python operator for addition of lists will
kick in and give a new Python list:
v = [v[0], v[1], v[0], v[1]]
so the dimensions won't match when you take the inner product.
If you want to have v --> v + delta*grad(q), you can do something like
v = [v[i] + delta*grad(q)[i] for i in len(v)]
This will be much better handled in upcoming versions of FFC which
will use the new form language UFL.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References