← Back to team overview

dolfin team mailing list archive

Re: [FFC-dev] functions

 

On Thu, Apr 12, 2007 at 05:58:51PM +0200, Garth N. Wells wrote:
> 
> 
> Martin Sandve Alnæs wrote:
> > 2007/4/12, Garth N. Wells <g.n.wells@xxxxxxxxxx>:
> >>
> >> Anders Logg wrote:
> >>> On Wed, Apr 11, 2007 at 06:15:30PM +0200, Garth N. Wells wrote:
> >>>> Anders Logg wrote:
> >>>>> On Tue, Apr 10, 2007 at 06:14:12PM +0200, Garth N. Wells wrote:
> >>>>>> Connected to Kristian's work on quadrature in FFC, we should think about
> >>>>>> how to work with functions which do not come from a finite element
> >>>>>> space. Such functions (like stress for a plasticity model or viscosity
> >>>>>> for a non-Newtonian flow) are evaluated at quadrature points, rather
> >>>>>> than at nodes.
> >>>>>>
> >>>>>> Garth
> >>>>> The current design (including UFC) assumes that all functions can be
> >>>>> interpolated to a finite element basis, but I think it will work for
> >>>>> the quadrature code generation to imagine that you have a finite
> >>>>> element basis where the quadrature points are the same as the nodes.
> >>>>> (But you never need to know the basis functions.)
> >>>>>
> >>>>> The array of coefficients (double** w) that comes in to the function
> >>>>> tabulate_tensor() should contain the coefficients, but for the
> >>>>> quadrature these will be the same as the values at the quadrature
> >>>>> points, and this should work out fine since the values that go in to w
> >>>>> are decided by the evaluate_dof() function that also gets
> >>>>> generated.
> >>>>>
> >>>>> So the quadrature code generator just needs to make sure that
> >>>>> evaluate_dof() picks the values at the quadrature points.
> >>>>>
> >>>> The problem with this approach is that it's not possible to create a
> >>>> consistent linearisation when dofs and integration points do not
> >>>> coincide. Kristian and I went through this in detail a while ago.
> >>>>
> >>>> Garth
> >>> Yes, I remember, but my suggestion was that the dofs and the points
> >>> should coincide. Then the linearization should be ok?
> >>>
> >> I don't see how this can work. The locations of the dofs and the Gauss
> >> quadrature points do not in general coincide.
> > 
> > The idea is to construct an "artificial finite element" where the dofs
> > _are_ values in the Gauss quadrature points. By generating a
> > corresponding implementation of ufc::finite_element where
> > evaluate_dof(i, f, ...) evaluates the function f in dof (quadpoint) i,
> > and local_dimension() returns the number of quadrature points, this
> > should work.
> >
> 
> Isn't this getting overly-complicated? It would also be necessary to 
> evaluate the functions and derivatives of functions on the "real" 
> element at the dofs of the artificial element (to compute a stress 
> update in a plasticity problem, for example).
> 
> Garth

I thought you wanted to have the quadrature points coincide with the
nodes?

My understanding of this problem is the following: You have a linear
form L(v) that you assemble into a vector b, and you want to compute
the derivative db_i/db_j by assembling a matrix from some suitable
bilinear form.

The problem is then that the nonlinearity in L is computed by
operating directly on the dofs of the function you want to solve
for. For example, you have

    L(v) = \int v sin(u) dx

and you compute sin(u) in the integral by taking sin() of all the dofs
for u (which makes sense for a Lagrange basis).

The result is that when you differentiate L to get a bilinear form a and
assemble it into a matrix, you will get something that is
approximately the the derivative of b, but not exactly, since you have
approximated the function sin(u).

But (correct me if I'm wrong here) if you take sin() of u at all the
quadrature points you use to compute the integral, you will
approximate both L and a, but in such a way that the matrix A you get
from a will be the exact derivative of b.

So would it be enough to get the values of u at the quadrature points
and then apply the nonlinearity to those values?

/Anders


References