Subject: [UFC-dev] Another extension of UFC

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 17 Dec 2007 12:44:56 +0100

We already have:

class finite_element
{
    /// Evaluate linear functional for dof i on the function f
    virtual double evaluate_dof(unsigned int i,
                                const function& f,
                                const cell& c) const = 0;
};

But this is very inefficient for elements/functions with value rank >
0, f.ex. a 3D tensor function will be evaluated 3x3=9 times more than
necessary. I suggest we add the following signature (in UFC 1.1
together with the previously proposed additons to dof_map):

class finite_element
{
    /// Evaluate linear functionals for all dofs on the function f
    virtual void evaluate_dofs(double *values,
                                const function& f,
                                const cell& c) const;
};

-- 
Martin

---

From: Kent-Andre Mardal <[email-masked]>
Date: Mon, 17 Dec 2007 14:28:07 +0100

Agree, but anyhow this is a one time operation. It is not done for each
element is it ? 

Kent

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Mon, 17 Dec 2007 13:35:48 +0100

On the contrary, the current cell is an argument to this function as
you see in the code. This is then called once for each element,
instead of once for each local dof for each element. This operation
can potentially be applied for each coefficient in the form, each time
you assemble the form.

It will still not be optimal after this change, since it's cell-based
(element-based) and doesn't take dofs shared by two or more elements
into account. I don't think that is feasible to fix though.

--
Martin

-- 
Martin

---

From: Anders Logg <[email-masked]>
Date: Tue, 18 Dec 2007 16:00:30 +0100

>     virtual void evaluate_dofs(double *values,

Looks good to me. Maybe we should change "values" to "dof_values" for
clarity.

-- 
Anders

---

From: [email-masked]
Date: Tue, 18 Dec 2007 17:40:05 +0100 (CET)

I am sorry, I misread.

Kent

> _______________________________________________
> UFC-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufc-dev
>