On Wed, Apr 09, 2014 at 10:57:04AM +0200, Martin Sandve Alnæs wrote:
> For some reason ufl.Function was renamed to ufl.Coefficient some years ago. I
> don't believe I was part of the team at the time or at least I don't remember
> what the motivation was. Can someone enlighten me as to why this was done?

I don't remember now but I assume it was to match the concept of
Coefficient in UFC.

Function in DOLFIN is something very specific and Coefficient in UFL
is something that can be mapped either to a DOLFIN Function or
Expression (both of which are subclasses of GenericFunction).

> I'm now in the process of implementing several other new types in ufl that 
> will
> mirror types in dolfin. Naming of these types is a pain if they can't have the
> same name as in dolfin.
>
> We have this pattern today:
>
> dolfin.Function inherits from ufl.Coefficient and cpp.Function
>
> Which with the ufl.Function name would have been:
>
> dolfin.Function inherits from ufl.Function and cpp.Function
>
> however I'm not advocating renaming Coefficient to Function at the moment 
> (lots
> of work, no practical gain). What I worry about is creating bad names for new
> classes.

Would it be better if dolfin::GenericFunction were named dolfin::Coefficient?

> Part one of my plan is this:
>
> dolfin.Mesh inherits from ufl.Domain and cpp.Mesh (missing inheritance today)
> dolfin.MeshView inherits from ufl.Region and cpp.MeshView (neither exists
> today)

Why not Region or MeshView throughout?

> Part two is this (simplified, ufl classes do not exist today):
>
> dolfin.FunctionSpace inherits from ufl.FunctionSpace and cpp.FunctionSpace
> dolfin.MixedFunctionSpace inherits from ufl.MixedFunctionSpace and
> cpp.MixedFunctionSpace
>
> I haven't been able to find a suitable alternative to FunctionSpace and
> MixedFunctionSpace in ufl.
>
> So the question is twofold:
> - Is it a problem to have the same names in dolfin and ufl?

I think it's desirable to have the same names across UFL - DOLFIN -UFC.

--
Anders


> - If it is, can someone come up with an alternative name to FunctionSpace for
> ufl?
>
> Martin

> _______________________________________________
> fenics mailing list
> [email protected]
> http://fenicsproject.org/mailman/listinfo/fenics

_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to