Subject: [UFC-dev] About interpolate_vertex_values

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 29 Jan 2007 20:23:49 +0100

Shouldn't this have a cell argument? For elements without point values
in vertices, where actual interpolation will take place, the geometry
is probably important? I don't know much about this subject though.

    /// Interpolate vertex values from dof values
    virtual void interpolate_vertex_values(double* vertex_values,
                                           const double* dof_values) const = 0;

martin

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 30 Jan 2007 09:05:56 +0100

In my implementation in SyFi I simply compute the linear combination
of dof_values and basis functions, resulting in a possibly large
symbolic expression. By evaluating this in the vertex coordinates all
the x-y-z terms fall and we get a simple expression. However, if the
element isn't defined on a reference cell, then this can't be
possible. I'm adding the cell argument.

martin

On 1/29/07, [email-masked] <[email-masked]> wrote:
>
> I like this function, but I'm having trouble implementing this for e.g.
> Raviart-Thomas or Nedelec. I think the main problem here is that
> the element is not a partition of unity.
>
> I think we should worry about this function at a later time. But it
> seems that the cell should be one of the arguments.
>
> > _______________________________________________
> > UFC-dev mailing list
> > [email-masked]
> > http://fenics.org/mailman/listinfo/ufc-dev
> >
>
>
>

---

From: Anders Logg <[email-masked]>
Date: Tue, 30 Jan 2007 09:49:38 +0100

>                                            const double* dof_values) const = 0;

Good point. For basis functions that are mapped by the Piola transform
(like BDM elements) then the evaluation depends on the cell, in
particular the derivative and determinant of the affine map.

But we have a more serious problem with this function. The
evaluate_basis function has an argument

    double* values

where we put in all the values of the possibly tensor-valued function,
but in interpolate_vecrtex_values, I think we forgot about this (at
least I did) so that vertex_values is just an array of the values at
the vertices. If the basis is tensor-valued, how do we sort the vertex
values?

I suggest we sort them "row-major" in the order

    (vertex, tensor dim 0, tensor dim 1, ...)

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 30 Jan 2007 10:44:15 +0100

>     (vertex, tensor dim 0, tensor dim 1, ...)

Sounds like the same way I did it without thinking that this was an
issue. But you're right, we must be careful to document all such
conventions.

Here's an example from my newly generated code. I haven't verified it,
so it might be buggy. But you see the way the tensor (vector)
components are grouped.

void fe_VectorLagrangeFE_2_3D::interpolate_vertex_values(double* vertex_values,
                                              const double* dof_values,
                                              const ufc::cell & c) const
{
    vertex_values[0] = dof_values[0];
    vertex_values[1] = dof_values[1];
    vertex_values[2] = dof_values[2];

    vertex_values[3] = dof_values[6];
    vertex_values[4] = dof_values[7];
    vertex_values[5] = dof_values[8];

    vertex_values[6] = dof_values[15];
    vertex_values[7] = dof_values[16];
    vertex_values[8] = dof_values[17];

    vertex_values[9] = dof_values[27];
    vertex_values[10] = dof_values[28];
    vertex_values[11] = dof_values[29];
}

martin

---

From: Anders Logg <[email-masked]>
Date: Tue, 30 Jan 2007 11:23:42 +0100

Where should we put the PyDOLFIN demos relative to the C++ demos?

Some options:

    src/demo/c++
    src/demo/python

Or we keep all C++ demos where they are now and put the Python demos
in one of

    src/demo/python
    src/demo/pydolfin

I think src/demo/scripting/pydolfin is not optimal.

/Anders

---

From: Anders Logg <[email-masked]>
Date: Tue, 30 Jan 2007 11:24:21 +0100

Sorry, wrong mailing list... :-)

/Anders