← Back to team overview

ufl team mailing list archive

Re: legal form?

 

Quoting Martin Sandve Alnæs <martinal@xxxxxxxxx>:

> Hi,
> this shouldn't be legal, (u,U) and (v,V) here should be derived from
> mixed elements to be used in the same form:
> 
> e = element + element1
> v, V = TestFunctions(e)
> u, U = TrialFunctions(e)

I totally agree that this shouldn't be legal, I was just playing around and
accidentally tripped over the above case.
 
> I guess we should add some sanity checks for BasisFunctions with
> counts < 0 in validate_form().
> 
> Or how do you handle this in FFC?

It's currently not handled at all, depending on the order the terms are defined
it might crash the tensor representation, quadrature compiles *fine*, but a
FormError should be raised of course.

It would be nice if UFL could sort this out as it is wrong for all compilers.

Kristian

> Martin
> 
> 
> 
> On Mon, Feb 2, 2009 at 3:06 PM, Kristian Oelgaard
> <k.b.oelgaard@xxxxxxxxxx> wrote:
> >
> > Hello,
> >
> > Should the following form be legal in UFL?
> >
> > element = FiniteElement("Lagrange", triangle, 1)
> > element1 = VectorElement("Lagrange", triangle, 1)
> >
> > v = TestFunction(element)
> > u = TrialFunction(element)
> >
> > V = TestFunction(element1)
> > U = TrialFunction(element1)
> >
> > f = Function(element)
> >
> > a = inner(V, U)*dx + f*v*u*dx
> >
> > It passes the validate_form() in checks.py
> >
> > However, extracting basisfunctions yield:
> > [BasisFunction(VectorElement('Lagrange', Cell('triangle', 1), 1, 2), -2),
> > BasisFunction(VectorElement('Lagrange', Cell('triangle', 1), 1, 2), -1)]
> >
> > redefining the form:
> >
> > a = f*inner(V, U)*dx + v*u*dx
> >
> > The extract basis yield:
> >
> > [BasisFunction(FiniteElement('Lagrange', Cell('triangle', 1), 1), -2),
> > BasisFunction(FiniteElement('Lagrange', Cell('triangle', 1), 1), -1)]
> >
> >
> > Kristian
> > _______________________________________________
> > UFL-dev mailing list
> > UFL-dev@xxxxxxxxxx
> > http://fenics.org/mailman/listinfo/ufl-dev
> >
> 



----- End forwarded message -----