dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #11518
Re: FFC index notation for multilinear forms
On Mon, Jan 05, 2009 at 06:08:34PM -0500, Hatef Monajemi wrote:
> Hi
>
> I am trying to write a form file with index notation, however ffc gives me an
> error. I kind of found out what was the problem but I do not know how to
> resolve it in ffc. Considering the following form:
>
> ------------------------------------------------------------------------
>
> P2 = VectorElement("Lagrange", "triangle", 2)
> P1 = FiniteElement("Lagrange", "triangle", 1)
> TH = P2 + P1
>
> (v,w) = TestFunctions(TH)
> (U,P) = TrialFunctions(TH)
>
> a= v[i]*U[i]*dx
>
> -----------------------------------------------------------------------------
>
> ffc gives me the following error:
>
> **** object cannot be interpreted as an index
>
> But when I define just one test and trial fuction such as :
>
> v = TestFunction(P2)
> U = TrialFunction(P2)
>
> everything goes fine. I do need to define a set of Trial and Test fuctions
> since my variational form is not the one I just mentioned for illustration and
> contains two variables such as the one included in mixed poisson demo in
> dolfin. I have no problem when I do not use INDEX NOTATION. BTW, I need to use
> the index notation to define the nonlinear convective term in Navier-Stokes
> equation and solve the nonlinear problem with either Fixed Point or Newton's
> method.
>
> Any help in this regard is greatly appreciated.
>
> Hatef
Index notation in FFC does not work when test and trial functions are
defined using TestFunctions and TrialFunctions (only for non-compound
elements).
Use dot(grad(v), grad(u)) instead.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References