← Back to team overview

ffc team mailing list archive

Re: Formdata and basis functions.

 

On Thu, Nov 20, 2008 at 12:05:59AM +0100, Martin Sandve Alnæs wrote:
> 2008/11/19 Johan Hake <hake@xxxxxxxxx>:
> > Hello!
> >
> > We have been discussing to inherit the ffc.{Test,Trial,Basis}Function in
> > dolfin, and instantiate the function with a functionspace instead of an
> > element. Then in assemble.py we extract the functionspaces from the
> > basisfunctions in Formdata (Anders promised this).
> >
> > I had a look in Formdata to try to just extract the basis functions, similare
> > to the coefficients. But the problem is that these functions are not
> > represented in the monomial as the original u and v as they were created by
> > the user.
> >
> > I suppose this is a "feature" of the algrebra in ffc or have I missunderstood
> > it? The function that is used to define the coefficients can be extracted
> > using with c.f, should this be added for the basisfunctions too?
> 
> ...
> 
> > Will this be an issue in ufl?
> 
> Let me think aloud:
> 
> - Subclassing BasisFunction (Test and Trial aren't classes) poses no
> problems in itself.
> 
> - Attaching additional member variables and member functions in this
> class is ok, as long as names don't collide.
> 
> - Implementing any special function "__foo__" other than __init__ in
> the dolfin subclasses may cause trouble. This includes SWIG-generated
> functions, which I think should be ok if the UFL class has precedence
> over the SWIG-generated class in the inheritance list of the PyDOLFIN
> class.
> 
> - BasisFunction and Function objects in a UFL Form are never replaced
> with anything else, exactly with this in mind.

FFC calls the copy constructor of BasisFunction in many of the
algorithms to create new copies of BasisFunctions in new expressions.

I've added a public member "data" now to BasisFunction that will be
copied along to all copies. It defaults to None.

Will also add extraction of basis function data to FormData.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References