Subject: [UFL-dev] UFL and new release

From: Anders Logg <[email-masked]>
Date: Thu, 26 Mar 2009 21:44:50 +0100

FFC is now fully functional w.r.t. compilation of UFL forms, at least
judging by the demos in FFC which now all produce correct results.

The Poisson demo in DOLFIN has also been moved to UFL.

I therefore suggest we make new releases of FFC, UFL and DOLFIN:

  DOLFIN 0.9.2
  FFC 0.6.2
  UFL 0.1.0 ?
  SyFi/SFC?

This batch of releases will support both the old .form format and the
new .ufl format. After the release, we can get started on cleaning up
and removing the .form format.

In it's simplest form, the UFL form language looks very much like the
FFC form language. Here's a comparison for the Poisson demo:

FFC
---

  element = FiniteElement("Lagrange", "triangle", 1)

  v = TestFunction(element)
  u = TrialFunction(element)
  f = Function(element)

  a = dot(grad(v), grad(u))*dx
  L = v*f*dx

UFL
---

  element = FiniteElement("Lagrange", triangle, 1)

  v = TestFunction(element)
  u = TrialFunction(element)
  f = Function(element)

  a = inner(grad(v), grad(u))*dx # dot also works
  L = v*f*dx

However, UFL does much more, like treatment of tensor expressions,
nonlinear operators like sin, cos, exp, sqrt, differentiation of forms
w.r.t. variables etc. For more information, look at Martin's summary:

  http://www.fenics.org/wiki/UFL

UFL includes a script form2ufl that can be used to convert from the
old FFC form language to the new UFL form language. The script is not
foolproof but it may help in converting to the new format.

So, let's make a new release now (after getting the buildbot green
again for DOLFIN) and then make the full transition after the release.

It's also time to promote UFL from a development project (/dev) to a
proper project (/hg) since now FFC, SFC and DOLFIN will depend on it.
Any objections?

-- 
Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 27 Mar 2009 13:04:01 +0900

> proper project (/hg) since now FFC, SFC and DOLFIN will depend on it.

It would be worth checking with Kristian how far away the quadrature 
optimisations are for FFC + UFL. If it's only a few days, it would be 
good to wait on the FFC release since the new quadrature code is quite a 
bit slower than the old code (around a factor of 5 in some of my tests).

Garth

> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev

---

From: Kristian Oelgaard <[email-masked]>
Date: Fri, 27 Mar 2009 09:49:47 +0100

> bit slower than the old code (around a factor of 5 in some of my tests).

It's already there, just uncomment the optimise_options lines at the top of the
uflquadraturegenerator.py file.
However, there might still be bugs in the generated code and it compiles slower
(I've seen a factor of around 6-7 in some cases)

Some benchmark tests:

PressureEquation       FFC comp.    num. ops  assemble 2.5e6 times
Old FFC (*.form),+opt: 45.0s         26679          28.2s
New FFC (*.ufl), -opt:  0.9s        166086         110.0s
New FFC (*.ufl), +opt:  3.4s         15771          21.8s

DGElastoDynamics  FFC comp. | ops. a, dx | ops. a, dS | ops. L, dx | ops. L, dS
(*.form), +opt:     16m20s        791        2098         1571         4305
(*.ufl),  -opt:         7s      25776       93600        10008        23280
(*.ufl),  -opt:        45s       1217        2529         1375         2923

For the elasto-dynmics case, running 10 time steps on a 9000 element mesh takes
roughly 14.5s for both of the two optimised versions. The new FFC without
optimisation runs 1 second slower (15.6s).

Kristian

---

From: Johan Hake <[email-masked]>
Date: Fri, 27 Mar 2009 16:33:16 +0100

> The Poisson demo in DOLFIN has also been moved to UFL.

Should we also include the ufl version of the Poission python demo too?

This could be done by putting:

from dolfin import *
try:
    from dolfin.ufl import *
except:
    pass
    
at the top of the poission demo. 

If we want that we should probably release viper too, as a recent patch made 
it possible to plot ufl based PyDOLFIN Functions.

> I therefore suggest we make new releases of FFC, UFL and DOLFIN:

The added ufc.build_ufc_module is needed for the PyDOLFIN/ffc.jit so we will 
also need a UFC 1.1.2 release.

Johan