Subject: [UFC-dev] Essential BC

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 26 Dec 2006 14:41:51 +0100

I think we need this for essential BCs. Short version: we need to know
which dofs are on the boundary when a given facet is on the boundary.
Otherwise, we don't know on which dofs we have to set essential BC
values.

class dof_map
{
  virtual void tabulate_facet_dofs(
             uint dofs[],
             const uint facets[],
             const cell & c) = 0;
};

facets is an array of length num_facets_in_cell,
or mesh->num_entities[topdim-1], where
facets[i] is nonzero if dofs related to facet i is to be tabulated.

dofs is an array of length local_dimension(), where
dofs[i] is nonzero if local dof i gives a contribution
to the given facets.

I think this should be enough for essential boundary
conditions on the form \nu_i(u) = g_i, but I don't
know if this is enough for more exotic cases.

martin

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Tue, 26 Dec 2006 15:22:47 +0100

>   virtual void tabulate_facet_dofs(

(We also need the argument const mesh & m).

Based on the result of this, we can either pull the values from an
existing finite element vector using the same dof_map, or call
finite_element::evaluate_dof(...) for each of dof i where dofs[i] !=
0. An alternative could be:

class finite_element
{
  virtual void evaluate_facet_dofs(double values[], uint dofs[],
           const function & f, const uint facets, const cell & c,
const mesh & m) = 0;
};

But this doesn't allow simply restricting an existing FEM vector to
the boundary dofs.

martin

---

From: [email-masked]
Date: Wed, 27 Dec 2006 23:24:52 +0100 (CET)

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

Yes, I think we need something like this.

How about instead

  virtual void tabulate_facet_dofs(uint dofs[],
                                              const uint facet,
                                              const cell& c,
                                              const mesh& m) = 0;

?

The user asks the dof_map to tabulate the dofs on the given facet.
The difficulty is the length of the dofs array. We could add something like
num_facet_dofs() or we put in global_dimension() at the first position
that is not used and the length of dofs is local_dimension(). (Can't just
look at nonzero dofs since one dof is the zeroth dof.)

I suggest the first option, putting in num_facet_dofs() since it is more
explicit.

This would also mean that we assume the number of dofs is the same on each
facet but I don't think we have any elements in mind that don't satisfy
that.

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Thu, 28 Dec 2006 11:23:23 +0100

>   virtual void tabulate_facet_dofs(uint dofs[],

Good.

> look at nonzero dofs since one dof is the zeroth dof.)

That's the advantage of signed integers :)

> I suggest the first option, putting in num_facet_dofs() since it is more

Agree.

> facet but I don't think we have any elements in mind that don't satisfy

If we do have such elements, we could add an output

>   virtual void tabulate_facet_dofs(uint dofs[],
                                                 uint & num_dofs,
>                                               const mesh& m) = 0;

But I can't imagine why anyone would make such an element...

martin

---

From: [email-masked]
Date: Thu, 28 Dec 2006 12:33:50 +0100 (CET)

>>   virtual void tabulate_facet_dofs(uint dofs[],

I think this is nice! It will save a lot of work for us, the way we
have done it in pycc.

> But I can't imagine why anyone would make such an element...

h-p methods. The typical way to implement h-p methods is that
when you glue toghether two elements with different polynomial
order, you remove some degrees of freedom from the element
of the highest order. The degrees of freedom you remove are those
associated higher order terms on the meeting facet.

But, we have not started with h-p yet, so ...

Kent

---

From: [email-masked]
Date: Thu, 28 Dec 2006 19:12:01 +0100 (CET)

> I think this is nice! It will save a lot of work for us, the way we

It will save us some work in DOLFIN too. As it is now, FFC generates a
mapping of the points at which the dofs are evaluated and DOLFIN checks
each point to see which points are on the facet (by projecting the points
onto the facet).

It seems we agree, so just go ahead and add it.

/Anders