← Back to team overview

ffc team mailing list archive

Re: [Dolfin] [Branch ~dolfin-core/dolfin/main] Rev 4434: Set parameter to use tensor rep for DG Poisson demo. It's broken.

 

On Wed, Feb 03, 2010 at 08:04:54AM +0000, Garth N. Wells wrote:
>
>
> Anders Logg wrote:
> > On Tue, Feb 02, 2010 at 11:20:32PM -0000, noreply@xxxxxxxxxxxxx wrote:
> >> ------------------------------------------------------------
> >> revno: 4434
> >> committer: Garth N. Wells <gnw20@xxxxxxxxx>
> >> branch nick: dolfin-all
> >> timestamp: Tue 2010-02-02 23:16:44 +0000
> >> message:
> >>   Set parameter to use tensor rep for DG Poisson demo. It's broken.
> >>
> >>   This shows that tensor rep is not wotking for DG.
> >
> > I think it just shows that the tensor representation does not handle
> > FacetNormals
>
> This sounds to me like a significant deficiency. Is there are technical
> reason for this?

It has been like this for about a year (since the UFL introduction
last year). Before we had the quadrature option, we stretched the
tensor representation to support things it really couldn't handle like
division, sqrt etc by some tricks. When we did the UFL conversion last
year, I thought it best to remove these special tricks to keep the
implementation simple. FacetNormal is somewhere in between. It could
be added with some effort but since it is handled nicely by the
quadrature representation it is not a high priority to add back.

> or Division which is known.
>
> > Without the -r representation
> > option, FFC will automatically discover that the integrand in question
> > needs to be done with quadrature
>
> OK, it's good it if can figure this out.

Here's how FFC selects the representation:

1. If there's a quadrature element --> return "quadrature"

2. If tensor representation is not possible --> return "quadrature"

3. Compare estimated cost of tensor and quadrature representation and
use the most efficient option.

The above case gets quadrature because of 2.

The cost is estimated as the rank of the geometry tensor (number of
derivatives + number of coefficients) and tensor representation is
used if the cost is 3 or less. This can be fine-tuned with some
appropriate benchmarks.

--
Anders


> Garth
>
> > but if someone insists on -r tensor,
> > then FFC will try and explain why it fails:
> >
> >   *** FFC: No handler defined for expression Division.
> >
> > I'll switch the demo back to "auto".
> >
> >> modified:
> >>   demo/pde/dg/poisson/python/demo.py
> >>
> >>
> >
> >> === modified file 'demo/pde/dg/poisson/python/demo.py'
> >> --- demo/pde/dg/poisson/python/demo.py	2010-01-27 21:09:29 +0000
> >> +++ demo/pde/dg/poisson/python/demo.py	2010-02-02 23:16:44 +0000
> >> @@ -23,6 +23,8 @@
> >>
> >>  from dolfin import *
> >>
> >> +parameters["form_compiler"]["representation"] = "tensor"
> >> +
> >>  # Create mesh and define function space
> >>  mesh = UnitSquare(24, 24)
> >>  V = FunctionSpace(mesh, "DG", 1)
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help   : https://help.launchpad.net/ListHelp
>
>

Attachment: signature.asc
Description: Digital signature


References