← Back to team overview

ffc team mailing list archive

Re: New operators

 

On Thu, May 10, 2007 at 10:38:20PM +0200, kent-and@xxxxxxxxx wrote:
> > It is now possible to take the inverse, absolute value and square root
> > of functions in FFC.
> >
> > The operators are applied directly to the function coefficients so
> > this only makes sense for Lagrange elements (and then it only makes
> > limited sense for higher order elements).
> >
> > Here's an example:
> >
> >   element = FiniteElement("Lagrange", "triangle", 1)
> >
> >   v = TestFunction(element)
> >   u = TrialFunction(element)
> >   f = Function(element)
> >   g = Function(element)
> >
> >   a = sqrt(1/abs(1/f))*sqrt(g)*dot(grad(v), grad(u))*dx + \
> >       v*u*sqrt(f*g)*g*dx
> >
> > Pretty cool, but watch out...
> >
> > /Anders
> 
> Very Cool!
> So what does
> a = 1/f dx
> mean ?
> 
> Is it based on quadrature such that
> a = \sum_i (1/( sum_j f(x_i) N_j(x_i)) w_i,
> where x_i and w_i are quadrature nodes and weights
> and N_j are the finite element basis?
> How do you determine the order of the quadrature?
> 
> Kent

Almost, if a = 1/f, then

    a(x) = \sum_i (1/f_i) \phi_i(x)

where f_i are the expansion coefficients in the nodal basis. So it
makes sense for piecewise constants and it also makes limited sense
for higher order Lagrange elements.

/Anders


References