Subject: [FFC-dev] ufl

From: Patrick Riesen <[email-masked]>
Date: Sat, 06 Jun 2009 19:05:14 +0200

hello

following the example in the ufl manual it's possible to do things like
element = VectorElement("CG", cell, 3)
w = Function(element)
f = w**2/2*dx
F = derivative(f, w)
J = derivative(F, w)

but how do i give e.g. F and/or J to the forms a and L to get the code? 
when i tried just e.g. a = F it get

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
f = [[ v_{-1}[4], v_{-1}[5] ]]
g = 2
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expecting scalar expression f in f**g.
*** Expecting scalar expression f in f**g.

thanks for the help,
patrick

Anders Logg wrote:
> Yes, the bilinear form should be the linearized nonlinear form (not
> minus).
> 
> Note that with UFL, it's now possible to just write down the nonlinear
> form
> 
>   (v, F(u)) = 0 for all v
> 
> and then let UFL compute the linearization.
> 
>

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 8 Jun 2009 09:57:32 +0200

Hi Patrick,
w**2 doesn't work because w is a vector valued expression.
This should have been detected already at w**2, I'll take a look at that.
Instead, try:
  f = inner(w, w)/2*dx

Setting
  L, a = F, J
should work fine, or you can do
  forms = [F, J]
at the end of the form file (then you can define as many forms as you
like in one file).

Martin

On Sat, Jun 6, 2009 at 7:05 PM, Patrick Riesen<[email-masked]> wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev
>

---

From: Anders Logg <[email-masked]>
Date: Mon, 8 Jun 2009 10:05:55 +0200

> at the end of the form file (then you can define as many forms as you

Note that this (the forms = ... part) still won't work in FFC since
FFC is not using load_forms() from UFL yet. I hope to have that fixed
soon after the workshop.

-- 
Anders

---

From: Patrick Riesen <[email-masked]>
Date: Mon, 08 Jun 2009 11:46:53 +0200

hi martin

thank you, i could do the example things now :-)
but now when using ffc-ufl-generated code in dolfin, i have a problem, 
see the post on the dolfin list..

patrick

---

From: Patrick Riesen <[email-masked]>
Date: Mon, 08 Jun 2009 11:52:27 +0200

Sorry,
the error was because i split the implementation and forgot the *.cpp 
file... now it's seems ok,

best regards,
patrick