← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Make Data::update public.

 

On Sun, Oct 04, 2009 at 12:25:18AM +0200, Anders Logg wrote:
> On Sat, Oct 03, 2009 at 11:20:41PM +0100, Garth N. Wells wrote:
> >
> >
> > Anders Logg wrote:
> > > On Sat, Oct 03, 2009 at 10:59:39PM +0100, Garth N. Wells wrote:
> > >>
> > >> Anders Logg wrote:
> > >>> On Sat, Oct 03, 2009 at 11:12:15PM +0200, DOLFIN wrote:
> > >>>> One or more new changesets pushed to the primary dolfin repository.
> > >>>> A short summary of the last three changesets is included below.
> > >>>>
> > >>>> changeset:   7244:da48cdfb0ecf
> > >>>> tag:         tip
> > >>>> user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
> > >>>> date:        Sat Oct 03 13:34:09 2009 +0100
> > >>>> files:       dolfin/function/Data.h
> > >>>> description:
> > >>>> Make Data::update public.
> > >>>>
> > >>>> The Function design seems to be betting a bit complicated again.
> > >>> Let's revise it until it's simple enough. The point about the redesign
> > >>> is to make it simple.
> > >>>
> > >> I would like to not have the 'call back' to the eval functions in
> > >> Coefficient because they're hard to follow. Should we make
> > >>
> > >>      Coefficient::evaluate
> > >>
> > >> pure virtual for clarity?
> > >
> > > Would that help? Then both Expression and Function would need to
> > > reimplement the evaluate() function (in the same way) and both would
> > > need to handle the somewhat ugly update of the data object.
> > >
> >
> > I don't mind the update. I find it hard to follow code when the base
> > class calls functions which are implemented in the sub-class.
> >
> > Garth
>
> It's even worse: the Coefficient base class calls
> ufc::finite_element::evaluate_dof, which in turn calls evaluate in the
> ufc::function base class, which is implemented by the Coefficient
> (soon GenericFunction) subclass, which calls eval implemented in a
> subclass of Coefficient...

The good thing is this is now just a couple of lines: two very short
functions implemented in a total of 6 lines of code and they are very
isolated to GenericFunction.cpp, not hidden away among other functions
in Function.cpp.

So GenericFunction does two things: it is a base class for functions
and it takes care of the callback between DOLFIN and the UFC function
interface.

--
Anders

Attachment: signature.asc
Description: Digital signature


References