← Back to team overview

dolfin team mailing list archive

Re: New format of finite_element.signature()

 

On Friday 12 December 2008 00:20:49 Anders Logg wrote:
> On Thu, Dec 11, 2008 at 09:43:22PM +0100, Johan Hake wrote:
> > Hello!
> >
> > To be able to read a function from file in PyDOLFIN we have changed the
> > signature of generated code for a finite_element. It now equals:
> >
> >   'FiniteElement("Lagrange","Triangle",1)' aso
>
> But with lower-case "t" in "triangle"?

Yes of course. 

> > It is maybe not as readable as the other but now one can use that string
> > to create a ffc(ufl).FiniteElement in python given a compiled
> > finite_element, with just:
> >
> >   repr(fe.signature())
> >
> > You will need the newest version of ffc to be able to utelise DOLFIN
> > functionality that uses this signature(), e.g. read/write Functions
> > from/to a file.
> >
> > Also if you previously have stored a function to file, in an xml format,
> > you need to either save it again to be able to read it in (sic.) or
> > change the lines defining the signatures (finite_element and dof_map) in
> > the end of the file.
>
> Impressive!
>
> It seems to work fine here, but the plotting from C++ still doesn't
> work. The only thing that seems to be needed is to make it possible to
> do
>
>   f = Function("function.xml")
>
> that is, without the filename= argument. It would simplify the
> plotting (since it can can then handle Functions and Meshes in the
> same way), simplify the interface (no need to write "filename=") and
> make it uniform (both with the C++ interface for Function and with
> other classes in Python like the Mesh class).
>
> Since you already check for the .xml suffix in function.py, this
> should be rather easy. I was tempted to make the fix myself but was
> unsure I might break some logic. Could you make the fix?

I'll do.

Johan


Follow ups

References