On Wed, Jan 06, 2010 at 04:25:30PM +0100, Marie Rognes wrote:
Anders Logg wrote:
We've come pretty far on the rewrite of FFC and only a few functions
remain. As far as I can see, it remains to implement code generation
for the following functions:
Kristian:
code["evaluate_basis_all"] = not_implemented
code["evaluate_basis_derivatives"] = not_implemented
code["evaluate_basis_derivatives_all"] = not_implemented
Marie:
code["tabulate_entity_dofs"] = not_implemented # Marie doesn't know what this function should do
Evidently, my comment was unclear ;)
Should it look like this for CG_1?
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(unsigned int* dofs,
unsigned int d, unsigned int i) const
{
dofs[0] = i }
Yes, this function should return an array of the dofs (dof indices) for
the dofs associated with entity number i of dimension d.
But perhaps we should check the d and the i as well to make sure that
d == 0 and i <= d + 1?
Here's another example of what should happen for P3 in 2D.
switch (d)
{
case 0:
if (i > 2)
throw std::runtime_error("Sensible error message.");
dofs[0] = i;
case 1:
if (i > 2)
throw std::runtime_error("Sensible error message.");
dofs[0] = 3 + 2*i;
dofs[1] = 3 + 2*i + 1;
case 2:
if (i > 0)
throw std::runtime_error("Sensible error message.");
dofs[0] = 10;
default:
throw std::runtime_error("Sensible error message.");
}