dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #14478
Re: Issues with errornorm
On Friday 31 July 2009 22:40:13 Johan Hake wrote:
> On Saturday 01 August 2009 04:43:40 Marie Rognes wrote:
> > Hellu,
> >
> > errornorm.py seems to not work properly.
> >
> > This
> >
> > from dolfin import *
> > mesh = UnitSquare(2,2)
> > V = FunctionSpace(mesh, "CG", 1)
> > u = Function(V, "1.0")
> > v = Function(V, "2.0")
> > error = errornorm(u, v, "l2")
> >
> > gives
> >
> >
> > Traceback (most recent call last):
> > File "test_errornorm.py", line 8, in <module>
> > error = errornorm(u, v, "l2")
> > File
> > "/home/meg/local/lib64/python2.6/site-packages/dolfin/errornorm.py",
> > line 51, in errornorm
> > if not isinstance(u, cpp.Function):
> > NameError: global name 'cpp' is not defined
>
> This one was easy. A recent changed caused this.
>
> > Also value_rank() does not exist in my fenics installation.
> > rank() does however.
>
> This one was worse. In the errornorm function a function is supposed to
> have the value_rank method. As Marie points out, this methode does only
> excist in the FiniteElement class. This means that the error function has
> not worked properly for at least the last 6 month. Has no one used this
> function?
Sorry for this shoutout. I see now that the value_rank function that was used
was the former ffc.Function.value_rank. I was confused by the newly added
test for cpp.Function. However after the fix, we now only assume that a
cpp.Function is passed.
Johan
References