← Back to team overview

dolfin team mailing list archive

Re: Setting names of functions as written to file

 

This problem is not only related with python wrapper to Variable class. In PVTKFile.cpp you can find that dumped results is always named as "U".
So it doesn't matter how you call your function ;)

cheers,
BArtosz

Martin Sandve Alnæs wrote:
How can I set the name of a Function as it appears in a .pvd file?
When looking at two fields simultaneously in paraview, they need
separate names to have separate color ranges.


In Python I get this when trying rename:


In [16]: f.rename?
Type:		instancemethod
Base Class:	<type 'instancemethod'>
String Form:	<bound method DiscreteFunction.Variable_rename of
Function(FiniteElement('Lagrange', Cell('triangle', 1), 1), 0)>
Namespace:	Interactive
Docstring:
    Variable_rename(Variable self, string name, string label)


In [17]: f.rename("f", "m")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/martinal/<ipython console> in <module>()

TypeError: in method 'Variable_rename', argument 1 of type 'dolfin::Variable *'


No rush, I can of course just change the name in the .pvd file with
sed for now...

Martin
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev



References