← Back to team overview

ffc team mailing list archive

Re: Suggestions for changes [...]

 

On Wed, Jun 01, 2005 at 09:20:13AM -0500, Robert C.Kirby wrote:
> >>
> >
> >I need to think this through. At some point we probably need to add an
> >option for quadrature, but there may be other ways to handle it, for
> >
> 
> This is also possible to allow further experimentation.
> 
> >example by declaring dx differently. We currently have
> >
> >dx = Integral("interior")
> >...
> >a = u.dx(i)*v.dx(i)*dx
> >
> >The declaration of dx is normally not visible (it's added by the
> >simple FFC parser that preprocesses a given .form file and adds the
> >necessary declarations on top of the file).
> >
> >For quadrature, one could  do
> >
> >dx = Integral("interior quadrature")
> >...
> >a = u.dx(i)*v.dx(i)*dx
> >
> >Different terms can be integrated differently (quadrature or tensor)
> >and combined in the same form.
> 
> This is a good idea -- I meant by projection the L2 projection
> (Pi u,v) = (u,v) or the (local) H1 projection
> (grad( Pi u ) , grad( v ) ) = ( grad( u ) , grad( v ) )
> 
> as opposed to nodal interpolation.
> 
> Of course, opening up the possibility of varying quadrature is an 
> orthogonal dimension to these.
> 
> >>Rot/curl is a little trickier, as you need to know whether
> >>you're in 2d or 3d.
> >>
> >Good idea. I also need to add a scalar product (could overload the ','
> >operator) that translates
> >
> >    (grad(u), grad(v))
> >
> 
> I wouldn't overload the comma operator since that is used in duality 
> pairings and FFC works on integrands / measure.  I don't think you even 
> can overload , in Python.

You're probably right. (But you can in C++...)

> >Note that the index needs to be the same in both u.dx(i) and v.dx(i)
> >which means that grad(u) can probably not be mapped to u.dx(i), but
> >rather to a function that takes the index as an argument (and ',' will
> >give the same index to both u.dx() and v.dx()).
> >
> 
> You can introduce a class "grad" whose constructor takes a function, 
> and overload member __mul__ to take another "grad" instance and return 
> u.dx(i) * v.dx(i) for some appropriate index i.  See above comment on 
> ",".

Good idea, but I would probably create a class Gradient that overloads
'*' to create a new Index i and return u.dx(i) * v.dx(i) for that
Index. In addition, I will make a function grad() that returns a
Gradient.

/Anders



References