← Back to team overview

dolfin team mailing list archive

Setting names of functions as written to file

 

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


Follow ups