← Back to team overview

ffc team mailing list archive

Re: ufl

 

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

best regards,
patrick

Patrick Riesen wrote:
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


Martin Sandve Alnæs wrote:
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<priesen@xxxxxxxxxxxxxxx> wrote:
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.


_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev


_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



References