ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #02578
Re: ufl
On Mon, Jun 08, 2009 at 09:57:32AM +0200, 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).
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
> 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
Attachment:
signature.asc
Description: Digital signature
References
-
ufl
From: Patrick Riesen, 2009-06-06
-
Re: ufl
From: Martin Sandve Alnæs, 2009-06-08