On Thu, Jan 28, 2010 at 10:03:57PM +0100, Kristian Oelgaard wrote: > > > On 28 January 2010 21:59, Anders Logg <[email protected]> wrote: > >On Thu, Jan 28, 2010 at 09:56:18PM +0100, Kristian Oelgaard wrote: > >> > >> > >>On 28 January 2010 21:14, Marie Rognes <[email protected]> wrote: > >>>Kristian Oelgaard wrote: > >>>> > >>>> > >>>>2010/1/27 Medhi Nikbakht <[email protected]>: > >>>>> > >>>>>On Wed, 2010-01-27 at 15:50 +0100, Marie Rognes wrote: > >>>>>> > >>>>>>FFC compilation fails for > >>>>>> > >>>>>> ElementRestriction.ufl > >>>>> > >>>>>The error message says that "ElementRestriction" is not supported by > >>>>>FIAT. > >>>>>How will the restricted elements be implemented? Wouldn't it be better > >>>>>to support them inside FFC? > >>>> > >>>>There are two types of restrictions supported in UFL (and the old FFC). > >>>>1) Restriction onto Measure (like 'dc'), which is what you want. > >>>>2) Restriction onto Cell, as for instance restricting a Lagrange element > >>>>defined on a 'triangle' to its facets. > >>>> > >>>>The third restriction that we might want in the future is restriction onto > >>>>subdomains possible in UFL but not in FFC. > >>>> > >>>>To implement 1) I think it is enough to just attach the Measure as a > >>>>member to the fiat_element and the simply look for it in appropriate > >>>>places > >>>>when generating the code. That means handle it in FFC.fiatinterface, could > >>>>that work? > >>>> > >>>>To implement 2) I modified the return value of entity_dofs() and > >>>>tabulate() accordingly. To do it this way again we will need to make > >>>>changes > >>>>in FIAT_NEW.FiniteElement and FFC.MixedElement. I'm not sure it is a good > >>>>idea to make FIAT_NEW.PolynomialSet aware of restrictions, but I don't > >>>>know > >>>>enough about the FIAT internals to back up this claim. > >>>> > >>> > >>> > >>>How about adding a class RestrictedElement that contains an element and > >>>(based on the restriction) > >>>a list of relevant basis function indices, and overrides the methods as > >>>FiniteElement/MixedElement? > >> > >>Yes, that would be one option and we already have MixedElement and > >>RestrictedElement is much the same thing (we should change the name in > >>UFL). Although, one objective of this re-write of FFC was to remove as much > >>as possible w.r.t. FiniteElement. > >> > >>We could make the RestrictedElement a child class of FIAT.FiniteElement, > >>that should be OK since FFC uses FIAT as the backend for finite elements. > >>Then we just need to modify a few member functions. > > > >I think Marie's suggestion is cleaner with a the RestrictedElement > >class (or whatever it will be named) *has* an element. That element > >could perhaps be another mixed element. There are not that many > >functions to implement (about 8). > > Let's make it a new class then. > > Kristian
ok. I'll add a sketch but I'm not sure what should happen so I'll need help filling out the details. -- Anders
signature.asc
Description: Digital signature
_______________________________________________ Mailing list: https://launchpad.net/~ffc Post to : [email protected] Unsubscribe : https://launchpad.net/~ffc More help : https://help.launchpad.net/ListHelp

